* path.cc (check_sysfile): Don't scan string twice.

This commit is contained in:
Corinna Vinschen 2004-05-04 10:54:06 +00:00
parent 1af84bb7f5
commit ad7ba32b2d
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2004-05-04 Corinna Vinschen <corinna@vinschen.de>
* path.cc (check_sysfile): Don't scan string twice.
2004-05-03 Corinna Vinschen <corinna@vinschen.de>
* dir.cc (writable_directory): Remove.

View File

@ -2786,8 +2786,9 @@ check_sysfile (const char *path, DWORD fileattr, HANDLE h,
NUL. The length returned is the path without
*any* trailing NULs. We also have to handle (or
at least not die from) corrupted paths. */
if (memchr (contents, 0, got) != NULL)
res = strlen (contents);
char *end;
if ((end = (char *) memchr (contents, 0, got)) != NULL)
res = end - contents;
else
res = got;
}