* Re: [PATCH] Support DOS paths in dash [not found] ` <51545CD9.4050607@sidefx.com> @ 2014-09-30 22:02 ` Eric Blake 2014-10-02 0:41 ` Herbert Xu 0 siblings, 1 reply; 4+ messages in thread From: Eric Blake @ 2014-09-30 22:02 UTC (permalink / raw) To: Edward Lam, dash [-- Attachment #1: Type: text/plain, Size: 2637 bytes --] [I noticed an old thread in my inbox while packaging dash 0.5.8 for Cygwin] On 03/28/2013 09:08 AM, Edward Lam wrote [to the cygwin list]: >> The problem is that dash tries to convert c:/windows to an absolute >> path, since it doesn't start with /. I suppose I could teach dash to >> recognize [letter]:/ as absolute paths, although that makes dash larger, >> and puts a burden on me (since I can guarantee upstream dash won't >> accept such a patch). >> >>> I just don't care enough for DOS paths so I won't fix. >> >> Me neither. And since you can use /cygdrive/c, not c:/, I won't bother >> to fix it. >> > Hi Folks, > > I finally got down to looking at how to fix this in dash and came up > with the attached patch (against dash-0.5.7). It's simple enough and so > cd now works. > > Please consider this for Cygwin. > I'm not interested in burdening the cygwin build of dash with a one-off patch, so I'd like to gauge the upstream thoughts - is it worth including platform-specific patches like this (no penalty to build size of non-cygwin platforms, and on cygwin, it allows 'cd c:/' to behave as shorthand for 'cd /cygdrive/c/')? If the patch lands in dash.git, then I'll rebuild the cygwin port of dash to include a backport (rather than waiting for 0.5.9 to be released). If there is no interest, I'd rather just drop the patch. The cygwin community already states that /cygdrive/c notation is the official way to access drive letters, and that if 'c:/' works it is nice, but it is not a design goal to always have it work. > --- src/cd.c 2011-03-15 03:18:06.000000000 -0400 > +++ src/cd.new.c 2013-03-28 11:03:32.649576500 -0400 > @@ -38,6 +38,9 @@ > #include <string.h> > #include <unistd.h> > #include <limits.h> > +#ifdef __CYGWIN__ > +#include <sys/cygwin.h> > +#endif > > /* > * The cd and pwd commands. > @@ -194,6 +197,11 @@ > char *cdcomppath; > const char *lim; > > +#ifdef __CYGWIN__ > + char pathbuf[PATH_MAX + 1]; > + cygwin_conv_to_full_posix_path (dir, pathbuf); By the way, cygwin_conv_to_full_posix_path() is deprecated (it suffers from possible buffer overflow); these days, it's preferred to use: cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_RELATIVE, string, pathbuf, sizeof(pathbuf)) So, if there is interest in this patch upstream, I can respin it. > + dir = pathbuf; > +#endif > cdcomppath = sstrdup(dir); > STARTSTACKSTR(new); > if (*dir != '/') { > > -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 539 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Support DOS paths in dash 2014-09-30 22:02 ` [PATCH] Support DOS paths in dash Eric Blake @ 2014-10-02 0:41 ` Herbert Xu 2014-10-02 3:18 ` Edward Lam 0 siblings, 1 reply; 4+ messages in thread From: Herbert Xu @ 2014-10-02 0:41 UTC (permalink / raw) To: Eric Blake; +Cc: edward, dash Eric Blake <eblake@redhat.com> wrote: > > I'm not interested in burdening the cygwin build of dash with a one-off > patch, so I'd like to gauge the upstream thoughts - is it worth > including platform-specific patches like this (no penalty to build size > of non-cygwin platforms, and on cygwin, it allows 'cd c:/' to behave as > shorthand for 'cd /cygdrive/c/')? If the patch lands in dash.git, then > I'll rebuild the cygwin port of dash to include a backport (rather than > waiting for 0.5.9 to be released). If there is no interest, I'd rather > just drop the patch. The cygwin community already states that > /cygdrive/c notation is the official way to access drive letters, and > that if 'c:/' works it is nice, but it is not a design goal to always > have it work. It's fine by me. Cheers, -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Support DOS paths in dash 2014-10-02 0:41 ` Herbert Xu @ 2014-10-02 3:18 ` Edward Lam 2014-10-04 4:07 ` Herbert Xu 0 siblings, 1 reply; 4+ messages in thread From: Edward Lam @ 2014-10-02 3:18 UTC (permalink / raw) To: Herbert Xu; +Cc: Eric Blake, dash@vger.kernel.org > On Oct 1, 2014, at 8:41 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote: > > Eric Blake <eblake@redhat.com> wrote: >> >> I'm not interested in burdening the cygwin build of dash with a one-off >> patch, so I'd like to gauge the upstream thoughts - is it worth >> including platform-specific patches like this (no penalty to build size >> of non-cygwin platforms, and on cygwin, it allows 'cd c:/' to behave as >> shorthand for 'cd /cygdrive/c/')? If the patch lands in dash.git, then >> I'll rebuild the cygwin port of dash to include a backport (rather than >> waiting for 0.5.9 to be released). If there is no interest, I'd rather >> just drop the patch. The cygwin community already states that >> /cygdrive/c notation is the official way to access drive letters, and >> that if 'c:/' works it is nice, but it is not a design goal to always >> have it work. > > It's fine by me. > Is that a yes to allow platform-specific patches into dash? Thanks, -Edward ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Support DOS paths in dash 2014-10-02 3:18 ` Edward Lam @ 2014-10-04 4:07 ` Herbert Xu 0 siblings, 0 replies; 4+ messages in thread From: Herbert Xu @ 2014-10-04 4:07 UTC (permalink / raw) To: Edward Lam; +Cc: eblake, dash Edward Lam <edward@sidefx.com> wrote: > > >> On Oct 1, 2014, at 8:41 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote: >> >> Eric Blake <eblake@redhat.com> wrote: >>> >>> I'm not interested in burdening the cygwin build of dash with a one-off >>> patch, so I'd like to gauge the upstream thoughts - is it worth >>> including platform-specific patches like this (no penalty to build size >>> of non-cygwin platforms, and on cygwin, it allows 'cd c:/' to behave as >>> shorthand for 'cd /cygdrive/c/')? If the patch lands in dash.git, then >>> I'll rebuild the cygwin port of dash to include a backport (rather than >>> waiting for 0.5.9 to be released). If there is no interest, I'd rather >>> just drop the patch. The cygwin community already states that >>> /cygdrive/c notation is the official way to access drive letters, and >>> that if 'c:/' works it is nice, but it is not a design goal to always >>> have it work. >> >> It's fine by me. >> > > Is that a yes to allow platform-specific patches into dash? If there is zero impact on other platforms and it doesn't adversely impact the maintainability then yes. Cheers, -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-10-04 4:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <announce.4A5C7A2B.4020700@byu.net>
[not found] ` <4B5860C9.50100@sidefx.com>
[not found] ` <4B591221.10501@byu.net>
[not found] ` <4B91105B.7050205@sidefx.com>
[not found] ` <20100305152637.GK7980@calimero.vinschen.de>
[not found] ` <4B913788.40301@sidefx.com>
[not found] ` <4B913AF2.3070102@redhat.com>
[not found] ` <20100305172048.GN7980@calimero.vinschen.de>
[not found] ` <4EDA9E99.9030307@redhat.com>
[not found] ` <51545CD9.4050607@sidefx.com>
2014-09-30 22:02 ` [PATCH] Support DOS paths in dash Eric Blake
2014-10-02 0:41 ` Herbert Xu
2014-10-02 3:18 ` Edward Lam
2014-10-04 4:07 ` Herbert Xu
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.