* cygpath.cc (main): Allow multiple pathnames on command line.

This commit is contained in:
Corinna Vinschen 2003-11-07 18:30:35 +00:00
parent 182d0e28a7
commit 0a5ea9471b
2 changed files with 17 additions and 22 deletions

View File

@ -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

View File

@ -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
{