Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3F17FE02.6070307@fangorn.ca> Date: Fri, 18 Jul 2003 10:02:42 -0400 From: Mark Blackburn User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5a) Gecko/20030708 Thunderbird/0.1a X-Accept-Language: en-us, en MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: [PATCH] : make cygpath use multiple filename arguments References: <5 DOT 2 DOT 1 DOT 1 DOT 2 DOT 20030717223236 DOT 0203cde8 AT pop DOT sonic DOT net> In-Reply-To: <5.2.1.1.2.20030717223236.0203cde8@pop.sonic.net> Content-Type: multipart/mixed; boundary="------------060106030903060609050609" --------------060106030903060609050609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Randall R Schulz wrote: > Mark, > > Cygpath will process multiple names when it's operating as a filter. > > I suggest that your patch be changed to print each converted argument > on a separate line. > > Randall Schulz > > > At 13:53 2003-07-17, Mark Blackburn wrote: > >> Dunno if anybody will find this useful or not: >> >> Currently if you say: >> >> # cygpath -w /usr /lib >> >> you get a usage error. With my patch you get: >> >> # cygpath -w /usr /lib >> c:\cygwin\usr c:\cygwin\lib >> >> Mark. > > > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Problem reports: http://cygwin.com/problems.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > --------------060106030903060609050609 Content-Type: text/plain; name="cygpath.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cygpath.patch" Index: utils/cygpath.cc =================================================================== RCS file: /cvs/src/src/winsup/utils/cygpath.cc,v retrieving revision 1.28 diff -u -p -r1.28 cygpath.cc --- utils/cygpath.cc 12 Jun 2003 20:40:58 -0000 1.28 +++ utils/cygpath.cc 18 Jul 2003 13:59:37 -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 { --------------060106030903060609050609 Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ --------------060106030903060609050609--