diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-01-22 09:21:56 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-01-22 09:21:56 +0000 |
commit | 30352c261ce01bea8af3a9fa8433ed605f1f5031 (patch) | |
tree | 3703936f90e489632f6c3375d9d7601c213e3fb1 /winsup/utils | |
parent | 7d4be1efd53045983acf1d00041e70086d2c029f (diff) | |
download | newlib-30352c261ce01bea8af3a9fa8433ed605f1f5031.zip newlib-30352c261ce01bea8af3a9fa8433ed605f1f5031.tar.gz newlib-30352c261ce01bea8af3a9fa8433ed605f1f5031.tar.bz2 |
* cygpath.cc (dowin): Revert accidental checkin from November.
Diffstat (limited to 'winsup/utils')
-rw-r--r-- | winsup/utils/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/utils/cygpath.cc | 27 |
2 files changed, 23 insertions, 8 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 677ab6e..907f46bc 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,7 @@ +2004-01-22 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (dowin): Revert accidental checkin from November. + 2003-11-26 Corinna Vinschen <corinna@vinschen.de> * mkgroup.c (main): Print "root" group with local admins group sid diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc index e1942be..070b19b 100644 --- a/winsup/utils/cygpath.cc +++ b/winsup/utils/cygpath.cc @@ -9,8 +9,6 @@ details. */ #define NOCOMATTRIBUTE -#define _WIN32_IE 0x0400 - #include <shlobj.h> #include <stdio.h> #include <string.h> @@ -332,6 +330,7 @@ dowin (char option) char *buf, buf1[MAX_PATH], buf2[MAX_PATH]; DWORD len = MAX_PATH; WIN32_FIND_DATA w32_fd; + LPITEMIDLIST id; HINSTANCE k32; BOOL (*GetProfilesDirectoryAPtr) (LPSTR, LPDWORD) = 0; @@ -339,15 +338,27 @@ dowin (char option) switch (option) { case 'D': - if (!SHGetSpecialFolderPath (NULL, buf, allusers_flag ? - CSIDL_COMMON_DESKTOPDIRECTORY : CSIDL_DESKTOPDIRECTORY, FALSE)) - SHGetSpecialFolderPath (NULL, buf, CSIDL_DESKTOPDIRECTORY, FALSE); + SHGetSpecialFolderLocation (NULL, allusers_flag ? + CSIDL_COMMON_DESKTOPDIRECTORY : CSIDL_DESKTOPDIRECTORY, &id); + SHGetPathFromIDList (id, buf); + /* This if clause is a Fix for Win95 without any "All Users" */ + if (strlen (buf) == 0) + { + SHGetSpecialFolderLocation (NULL, CSIDL_DESKTOPDIRECTORY, &id); + SHGetPathFromIDList (id, buf); + } break; case 'P': - if (!SHGetSpecialFolderPath (NULL, buf, allusers_flag ? - CSIDL_COMMON_PROGRAMS : CSIDL_PROGRAMS, FALSE)) - SHGetSpecialFolderPath (NULL, buf, CSIDL_PROGRAMS, FALSE); + SHGetSpecialFolderLocation (NULL, allusers_flag ? + CSIDL_COMMON_PROGRAMS : CSIDL_PROGRAMS, &id); + SHGetPathFromIDList (id, buf); + /* This if clause is a Fix for Win95 without any "All Users" */ + if (strlen (buf) == 0) + { + SHGetSpecialFolderLocation (NULL, CSIDL_PROGRAMS, &id); + SHGetPathFromIDList (id, buf); + } break; case 'H': |