delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
X-Injected-Via-Gmane: | http://gmane.org/ |
To: | cygwin AT cygwin DOT com |
From: | Rolf Campbell <rcampbell AT tropicnetworks DOT com> |
Subject: | Re: [PATCH] : make cygpath use multiple filename arguments |
Date: | Thu, 17 Jul 2003 19:55:04 -0400 |
Lines: | 59 |
Message-ID: | <bf7cuv$l0g$2@main.gmane.org> |
References: | <3F170CE6 DOT 2040903 AT fangorn DOT ca> |
Reply-To: | IDontLikePersonalReplies AT hotmail DOT com |
Mime-Version: | 1.0 |
X-Complaints-To: | usenet AT main DOT gmane DOT org |
User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 |
X-Accept-Language: | en-us, en |
In-Reply-To: | <3F170CE6.2040903@fangorn.ca> |
What about filenames with spaces in them? Wouldn't the output be ambiguous? 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. > > > ------------------------------------------------------------------------ > > 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 17 Jul 2003 20:36:17 -0000 > @@ -479,7 +479,7 @@ doit (char *filename) > } > } > > - puts (buf); > + printf ("%s", buf); > } > > static void > @@ -675,11 +675,16 @@ 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++) { > + if (i != optind) > + printf(" "); > + filename = argv[i]; > + doit (filename); > + } > + printf("\n"); > } > else > { > > -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |