From 4fc92aa73009d62dfd4590fd296caf4dd1210755 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 17 Feb 2006 12:17:47 +0000 Subject: [PATCH] * cygpath.cc (get_long_name): Load GetLongPathNameA instead of incorrect GetLongPathName. (doit): Create mixed filename after converting to short or long pathname respectively. --- winsup/utils/ChangeLog | 7 +++++++ winsup/utils/cygpath.cc | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 17dc14f36..723c88d74 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,10 @@ +2006-02-17 Corinna Vinschen + + * cygpath.cc (get_long_name): Load GetLongPathNameA instead of incorrect + GetLongPathName. + (doit): Create mixed filename after converting to short or long pathname + respectively. + 2006-02-17 Jerry D. Hedden * ps.cc (main): Set aflag if -p option is given. diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc index 62657594c..d3e8ba658 100644 --- a/winsup/utils/cygpath.cc +++ b/winsup/utils/cygpath.cc @@ -234,7 +234,7 @@ get_long_name (const char *filename, DWORD& len) char *sbuf, buf[MAX_PATH]; static HINSTANCE k32 = LoadLibrary ("kernel32.dll"); static DWORD (WINAPI *GetLongPathName) (LPCSTR, LPSTR, DWORD) = - (DWORD (WINAPI *) (LPCSTR, LPSTR, DWORD)) GetProcAddress (k32, "GetLongPathName"); + (DWORD (WINAPI *) (LPCSTR, LPSTR, DWORD)) GetProcAddress (k32, "GetLongPathNameA"); if (!GetLongPathName) GetLongPathName = get_long_path_name_w32impl; @@ -497,8 +497,6 @@ doit (char *filename) conv_func = (absolute_flag ? cygwin_conv_to_full_win32_path : cygwin_conv_to_win32_path); err = conv_func (filename, buf); - if (mixed_flag) - buf = get_mixed_name (buf); if (err) { fprintf (stderr, "%s: error converting \"%s\" - %s\n", @@ -511,6 +509,8 @@ doit (char *filename) buf = get_short_name (buf); if (longname_flag) buf = get_long_name (buf, len); + if (mixed_flag) + buf = get_mixed_name (buf); } }