diff options
author | Christopher Faylor <me@cgf.cx> | 2003-01-30 23:15:15 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-01-30 23:15:15 +0000 |
commit | 704ce461988df7280145d59b81ce39a344c23e3d (patch) | |
tree | 52c7b9c5ee4843c86bb1464fa50641cd0e1f3761 | |
parent | ca8def3d9ac2df0dfdc5a2f38c496316344facf6 (diff) | |
download | newlib-704ce461988df7280145d59b81ce39a344c23e3d.zip newlib-704ce461988df7280145d59b81ce39a344c23e3d.tar.gz newlib-704ce461988df7280145d59b81ce39a344c23e3d.tar.bz2 |
* fhandler_registry.cc (fhandler_registry::exists): Fix off-by-one error when
inspecting path.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_registry.cc | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2b5b4e5..9b9a037 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-01-30 Christopher Faylor <cgf@redhat.com> + + * fhandler_registry.cc (fhandler_registry::exists): Fix off-by-one + error when inspecting path. + 2003-01-29 Christopher Faylor <cgf@redhat.com> * lib/getopt.c: Allow environment variable control of POSIXLY_INCORRECT diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc index 18e1db4..2d6aeb8 100644 --- a/winsup/cygwin/fhandler_registry.cc +++ b/winsup/cygwin/fhandler_registry.cc @@ -106,8 +106,10 @@ fhandler_registry::exists () const char *path = get_name (); debug_printf ("exists (%s)", path); - path += proc_len + registry_len + 2; - if (*path == 0) + path += proc_len + registry_len + 1; + if (*path) + path++; + else { file_type = 2; goto out; |