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]

Re: [PATCH]: Still stripping



Christopher Faylor wrote:
> 
> On Thu, Dec 23, 2004 at 11:42:15AM -0500, Pierre A. Humblet wrote:
> >In a case such as "abc..exe", the posix_path "abc." should not be
> >stripped. The patch below only strips the posix path if the win32
> >path was stripped. I don't think that the posix path can be empty
> >in that case.
> >
> >2004-12-23  Pierre Humblet <pierre.humblet@ieee.org>
> >
> >       * path.h (path_conv::set_normalized_path): Add second argument.
> >       * path.cc (path_conv::check): Declare, set and use "strip_tail".
> >       (path_conv::set_normalized_path): Add and use second argument,
> >       replacing all tail stripping tests.
> >
> 
> I'm not sure that your assumption of dot stripping is true in the first
> case of set_normalized_path in build_fh_dev in dtable.cc.  

Not sure I understand what you mean. At any rate there are two cases
where build_fh_dev is called with a non-empty second argument:
handler_tty.cc:  console = (fhandler_console *) build_fh_dev (*console_dev, "/dev/ttym");
path.cc:              fhandler_virtual *fh = (fhandler_virtual *) build_fh_dev (dev, path_copy); 
Neither is about a disk path.

> I do like the
> idea of letting the previously derived path_conv tail stripping test
> control whether set_normalized_path does stripping or not, though.
> 
> I have grown to dislike default parameters in c++.  I'm not sure why because
> I used to think they were pretty nifty.  

OK. Same here, having been burned.

> So, I'll check in your patch minus
> the default and keeping the original while loop in set_normalized_path
> more or less intact.

Aren't they the same? I thought it was nice to avoid having a strlen in one
case and a strchr in another. 

Pierre


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