diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-05-04 10:54:06 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-05-04 10:54:06 +0000 |
commit | ad7ba32b2d28af951447f332284879d98237bbe3 (patch) | |
tree | 9dfb41e52884ad2383c4d1726ac1e1428bd6e6e3 /winsup/cygwin | |
parent | 1af84bb7f58c0aecfc1b5c6b6685e14afe36785e (diff) | |
download | newlib-ad7ba32b2d28af951447f332284879d98237bbe3.zip newlib-ad7ba32b2d28af951447f332284879d98237bbe3.tar.gz newlib-ad7ba32b2d28af951447f332284879d98237bbe3.tar.bz2 |
* path.cc (check_sysfile): Don't scan string twice.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 767ceff..0be6648 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -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. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 59e454b..0527491 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -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; } |