This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
[PATCH] : make cygpath use multiple filename arguments
- From: Mark Blackburn <marklist at fangorn dot ca>
- To: cygwin-patches at cygwin dot com
- Date: Thu, 06 Nov 2003 11:57:35 -0500
- Subject: [PATCH] : make cygpath use multiple filename arguments
This patch will allow you to do this.
$ ./cygpath.exe -w -a cygpath.cc cygpath.exe
E:\cygwin\usr\src\cygwin-cvs\src\winsup\utils\cygpath.cc
E:\cygwin\usr\src\cygwin-cvs\src\winsup\utils\cygpath.exe
I don't know if this is desired behaviour or not. Personally, I would
find it useful.
Mark Blackburn
Index: src/winsup/utils/cygpath.cc
===================================================================
RCS file: /cvs/src/src/winsup/utils/cygpath.cc,v
retrieving revision 1.31
diff -u -p -r1.31 cygpath.cc
--- src/winsup/utils/cygpath.cc 17 Oct 2003 17:20:06 -0000 1.31
+++ src/winsup/utils/cygpath.cc 6 Nov 2003 15:36:05 -0000
@@ -675,11 +675,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
{