Re: [PATCH v15 02/16] path.c: refactor relative_path(), not only strip prefix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013/6/27 Junio C Hamano <gitster@xxxxxxxxx>:
>> +             } else {
>> +                     i++;
>> +                     j++;
>> +             }
>> +     }
>> +
>> +     if (
>> +         /* "prefix" seems like prefix of "in" */
>> +         i >= prefix_len &&
>
> So shouldn't this be "i == prefix_len"?
>
>> +         /*
>> +          * but "/foo" is not a prefix of "/foobar"
>> +          * (i.e. prefix not end with '/')
>> +          */
>> +         prefix_off < prefix_len) {
>> +             if (j >= in_len) {
>
> Again, "j == in_len", isn't it?  Or can i and j overrun in_len and
> prefix_len?

Yes, better write as ==. But both will pass the test cases.
Since this commit has been merged to next, so let it be?


-- 
Jiang Xin
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]