Re: [PATCH bw/realpath-wo-chdir] real_path: canonicalize directory separators in root parts

2016-12-22 Thread Junio C Hamano
Brandon Williams writes: > On 12/22, Johannes Sixt wrote: >> Am 21.12.2016 um 23:33 schrieb Brandon Williams: >> >On 12/21, Johannes Sixt wrote: >> >>+/* copies root part from remaining to resolved, canonicalizing it on the >> >>way */ >> >>+static void get_root_part(struct

Re: [PATCH bw/realpath-wo-chdir] real_path: canonicalize directory separators in root parts

2016-12-22 Thread Johannes Sixt
Am 22.12.2016 um 18:33 schrieb Brandon Williams: It took me a couple extra seconds to realize that offset_1st_component returns 0 with a relative path, which makes causes the call to get_root_part to essentially be a noop (ie nothing is resolved). Yeah, I am still unsure whether it is a good

Re: [PATCH bw/realpath-wo-chdir] real_path: canonicalize directory separators in root parts

2016-12-22 Thread Brandon Williams
On 12/22, Johannes Sixt wrote: > Am 21.12.2016 um 23:33 schrieb Brandon Williams: > >On 12/21, Johannes Sixt wrote: > >>+/* copies root part from remaining to resolved, canonicalizing it on the > >>way */ > >>+static void get_root_part(struct strbuf *resolved, struct strbuf > >>*remaining) >

Re: [PATCH bw/realpath-wo-chdir] real_path: canonicalize directory separators in root parts

2016-12-21 Thread Johannes Sixt
Am 21.12.2016 um 23:33 schrieb Brandon Williams: On 12/21, Johannes Sixt wrote: +/* copies root part from remaining to resolved, canonicalizing it on the way */ +static void get_root_part(struct strbuf *resolved, struct strbuf *remaining) +{ + int offset =

Re: [PATCH bw/realpath-wo-chdir] real_path: canonicalize directory separators in root parts

2016-12-21 Thread Brandon Williams
On 12/21, Johannes Sixt wrote: > When an absolute path is resolved, resolution begins at the first path > component after the root part. The root part is just copied verbatim, > because it must not be inspected for symbolic links. For POSIX paths, > this is just the initial slash, but on Windows,

[PATCH bw/realpath-wo-chdir] real_path: canonicalize directory separators in root parts

2016-12-21 Thread Johannes Sixt
When an absolute path is resolved, resolution begins at the first path component after the root part. The root part is just copied verbatim, because it must not be inspected for symbolic links. For POSIX paths, this is just the initial slash, but on Windows, the root part has the forms c:\ or