Adapt fixdep to support Windows.

Text files on windows are be created with a different format
for line endings. This commit improves the host tool 'fixdep' to
support files with the windows-style line endings.

Change-Id: I1d120790c5cbb1f1e7df6761821bc7e01c99b988
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
This commit is contained in:
Yonattan Louise 2015-09-22 19:45:35 -05:00 committed by Anas Nashif
commit 2ccaed8720

View file

@ -328,11 +328,12 @@ static void parse_dep_file(void *map, size_t len)
while (m < end) {
/* Skip any "white space" */
while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
while (m < end && (*m == ' ' || *m == '\\' || *m == '\n' || *m == '\r'))
m++;
/* Find next "white space" */
p = m;
while (p < end && *p != ' ' && *p != '\\' && *p != '\n')
while (p < end && *p != ' ' && !(*p == '\\' && *(p+1) == '\r')
&& *p != '\r' && *p != '\n')
p++;
/* Is the token we found a target name? */
is_target = (*(p-1) == ':');
@ -346,7 +347,8 @@ static void parse_dep_file(void *map, size_t len)
s[p - m] = 0;
/* Ignore certain dependencies */
if (strrcmp(s, "include/generated/autoconf.h") &&
if ((m < end) &&
strrcmp(s, "include/generated/autoconf.h") &&
strrcmp(s, "arch/um/include/uml-config.h") &&
strrcmp(s, "include/linux/kconfig.h") &&
strrcmp(s, ".ver")) {