Re: [PATCH 7/7] t0000: verify that real_path() removes extra slashes
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 6, 2012, 03:23 UTC
- Message-ID
- <7v1uif7s1d.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CACsJy8DAbp1uDsNFFk1g9tuEV1qMnM2DZtxOwp5H9_VE7VwO1g@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 12 quoted lines
> diff --git a/path.c b/path.c > index 66acd24..ad2881c 100644 > --- a/path.c > +++ b/path.c > @@ -503,6 +503,10 @@ int normalize_path_copy(char *dst, const char *src) > *dst++ = *src++; > *dst++ = *src++; > } > +#ifdef WIN32 > + else if (src[0] == '/' && src[1] == '/') > + *dst++ = *src++; > +#endif
The two-byte copy we see above the context is conditional on a nice abstraction "has_dos_drive_prefix()" so that we do not have to suffer from these ugly ifdefs. Could we do something similar?
-- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en