Skip to content

Commit c918f5c

Browse files
dschogitster
authored andcommitted
relative_url(): fix incorrect condition
In 63e95be (submodule: port resolve_relative_url from shell to C, 2016-04-15), we added a loop over `url` where we are looking for `../` or `./` components. The loop condition we used is the pointer `url` itself, which is clearly not what we wanted. Pointed out by Coverity. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 41f1a8e commit c918f5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2846,7 +2846,7 @@ char *relative_url(const char *remote_url, const char *url,
28462846
* When the url starts with '../', remove that and the
28472847
* last directory in remoteurl.
28482848
*/
2849-
while (url) {
2849+
while (*url) {
28502850
if (starts_with_dot_dot_slash_native(url)) {
28512851
url += 3;
28522852
colonsep |= chop_last_dir(&remoteurl, is_relative);

0 commit comments

Comments
 (0)