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
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-07-31 11:31:56 +0400
committerCorinna Vinschen <corinna@vinschen.de>2006-07-31 11:31:56 +0400
commitacc31d1a908599d78d5ba615e7e2cea3a0a74e96 (patch)
treea4e52fcba301a67bdb8f817c7bcbd035af141e41 /winsup/utils/cygpath.cc
parent4838aa88d996cd6b69b836b986b9df898c3ff834 (diff)
* cygpath.cc (get_long_name): Fallback to get_long_path_name_w32impl.
Diffstat (limited to 'winsup/utils/cygpath.cc')
-rw-r--r--winsup/utils/cygpath.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc
index 52282a615..96738b186 100644
--- a/winsup/utils/cygpath.cc
+++ b/winsup/utils/cygpath.cc
@@ -241,15 +241,22 @@ get_long_name (const char *filename, DWORD& len)
len = GetLongPathName (filename, buf, MAX_PATH);
if (len == 0)
{
- if (GetLastError () == ERROR_INVALID_PARAMETER)
+ DWORD err = GetLastError ();
+
+ if (err == ERROR_INVALID_PARAMETER)
{
fprintf (stderr, "%s: cannot create long name of %s\n", prog_name,
filename);
exit (2);
}
- buf[0] = '\0';
- strncat (buf, filename, MAX_PATH - 1);
- len = strlen (buf);
+ else if (err == ERROR_FILE_NOT_FOUND)
+ len = get_long_path_name_w32impl (filename, buf, MAX_PATH);
+ else
+ {
+ buf[0] = '\0';
+ strncat (buf, filename, MAX_PATH - 1);
+ len = strlen (buf);
+ }
}
sbuf = (char *) malloc (len + 1);
if (!sbuf)