Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-05-04 14:54:06 +0400
committerCorinna Vinschen <corinna@vinschen.de>2004-05-04 14:54:06 +0400
commitad7ba32b2d28af951447f332284879d98237bbe3 (patch)
tree9dfb41e52884ad2383c4d1726ac1e1428bd6e6e3 /winsup
parent1af84bb7f58c0aecfc1b5c6b6685e14afe36785e (diff)
* path.cc (check_sysfile): Don't scan string twice.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/path.cc5
2 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 767ceff06..0be6648fb 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 59e454bfc..052749122 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;
}