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:
-rw-r--r--winsup/utils/ChangeLog4
-rw-r--r--winsup/utils/cygpath.cc35
2 files changed, 17 insertions, 22 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index eb46b1c38..64f4433ee 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,7 @@
+2003-11-07 Mark Blackburn <marklist@fangorn.ca>
+
+ * cygpath.cc (main): Allow multiple pathnames on command line.
+
2003-11-04 Corinna Vinschen <corinna@vinschen.de>
* passwd.c (PrintPW): Turn around meaning printed for "Password not
diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc
index 68a2407fc..e1942be34 100644
--- a/winsup/utils/cygpath.cc
+++ b/winsup/utils/cygpath.cc
@@ -9,6 +9,8 @@ details. */
#define NOCOMATTRIBUTE
+#define _WIN32_IE 0x0400
+
#include <shlobj.h>
#include <stdio.h>
#include <string.h>
@@ -330,7 +332,6 @@ 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;
@@ -338,27 +339,15 @@ dowin (char option)
switch (option)
{
case 'D':
- 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);
- }
+ if (!SHGetSpecialFolderPath (NULL, buf, allusers_flag ?
+ CSIDL_COMMON_DESKTOPDIRECTORY : CSIDL_DESKTOPDIRECTORY, FALSE))
+ SHGetSpecialFolderPath (NULL, buf, CSIDL_DESKTOPDIRECTORY, FALSE);
break;
case 'P':
- 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);
- }
+ if (!SHGetSpecialFolderPath (NULL, buf, allusers_flag ?
+ CSIDL_COMMON_PROGRAMS : CSIDL_PROGRAMS, FALSE))
+ SHGetSpecialFolderPath (NULL, buf, CSIDL_PROGRAMS, FALSE);
break;
case 'H':
@@ -675,11 +664,13 @@ main (int argc, char **argv)
if (output_flag)
dowin (o);
- if (optind != argc - 1)
+ if (optind > argc - 1)
usage (stderr, 1);
- filename = argv[optind];
- doit (filename);
+ for (int i=optind; argv[i]; i++) {
+ filename = argv[i];
+ doit (filename);
+ }
}
else
{