From 0e40db8a3be867ba0d0528588b38e4bf6e0623c8 Mon Sep 17 00:00:00 2001 From: Juan Manuel Cruz Date: Mon, 18 Apr 2016 15:22:54 -0500 Subject: [PATCH] build: fixes issue in windows Kconfig support It allows to silently ignore non-existent files. When using wildcards in Kconfig source files (e.g. source folder/*/Kconfig), it is possible to refer files that does not exist. In the previous example, it is possible that Kconfig files do not exist in one of the folder's subfolders and it is not a requirement for the file to exist in each one of the subfolders. Additionally, it fixes an issue for wildcards in the file name. If the name contains a wildcard, Kconfig should iterate over each file included in the wildcard (e.g source folder/myKconfig.*) Jira: ZEP-177 Change-Id: I5aa192ca1e2df83461b12a86fe29a98cd95c4256 Signed-off-by: Juan Manuel Cruz --- scripts/kconfig/zconf.l | 7 +++++-- scripts/kconfig/zconf.lex.c_shipped | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 986759cf63c..d1ec0b98f25 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -407,8 +407,13 @@ void win_process_files(const char *files_path) if (hFind != INVALID_HANDLE_VALUE) { do { + char *strfile; GetFullPathName(fullname, PATH_MAX, path, lppPart); strcpy(fullname, path); + strfile = strrchr(fullname, '\\'); + if(strfile){ + sprintf(strfile, "\\%s", FindFileData.cFileName); + } zconf_nextfile(fullname); } while (FindNextFile(hFind, &FindFileData) != 0); @@ -417,8 +422,6 @@ void win_process_files(const char *files_path) if (dwError != ERROR_NO_MORE_FILES) { printf ("Error processing '%s' #%lu.\n", fullname, dwError); } - } else { - printf ("Error processing '%s' #%lu.\n", fullname, GetLastError()); } } diff --git a/scripts/kconfig/zconf.lex.c_shipped b/scripts/kconfig/zconf.lex.c_shipped index b4aa7206ce3..7c3a9b318c7 100644 --- a/scripts/kconfig/zconf.lex.c_shipped +++ b/scripts/kconfig/zconf.lex.c_shipped @@ -2462,8 +2462,13 @@ void win_process_files(const char *files_path) if (hFind != INVALID_HANDLE_VALUE) { do { + char *strfile; GetFullPathName(fullname, PATH_MAX, path, lppPart); strcpy(fullname, path); + strfile = strrchr(fullname, '\\'); + if(strfile){ + sprintf(strfile, "\\%s", FindFileData.cFileName); + } zconf_nextfile(fullname); } while (FindNextFile(hFind, &FindFileData) != 0); @@ -2472,8 +2477,6 @@ void win_process_files(const char *files_path) if (dwError != ERROR_NO_MORE_FILES) { printf ("Error processing '%s' #%lu.\n", fullname, dwError); } - } else { - printf ("Error processing '%s' #%lu.\n", fullname, GetLastError()); } }