This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using cygpath to ensure path format


Hi,

This patch got sent to <cygwin at cygwin dot com>, but this is a more
proper list for it, so I'm resending it here with a better subject.
	Igor

On Tue, 11 Feb 2003, Max Bowsher wrote:

> Igor Pechtchanski wrote:
> > It makes an assumption that the format is Windows.  Otherwise,
> > there'd be no need to convert to Unix format...
>
> Of course, if you simply wanted to *ensure* that the path was in unix
> format... you're stuck.

Yes.  I tracked the change to the following cvs commit:
<http://cygwin.com/ml/cygwin-cvs/2002-q4/msg00080.html>, particularly the
"(doit): Do various things to make path output work predictably." part.

> >> Is there another utility that can be used to identify the format of a
> >> classpath?  This will be needed to account for the changed behaviour
> >> in modifying scripts.
> >
> > Umm, 'grep'?  In particular, grep for a ";" or a "\" for a
> > windows-format path...
>
> Which is presumably vaguely what cygpath used to do.
>
> Doug: have you considered making a patch to cygpath to make it behave more
> to your liking (conditional on a command line option if need be), and
> submitting that?
>
> Max.

Umm, since I've opened my mouth on the issue, I'll submit the patch...
        Igor
==========================================================================
ChangeLog:
2003-02-11  Igor Pechtchanski <pechtcha@cs.nyu.edu>

	* cygpath.cc (doit): Add code to simply ensure the path is
	in the right format.
	(ensure_flag): New static variable.
	(options,long_options): Add 'e' flag.
	(main): Set ensure_flag.

-- 
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_                pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_            igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'           Igor Pechtchanski
    '---''(_/--'  `-'\_) fL     a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune

Attachment: cygpath-ensure-flag.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]