Skip to content

Commit 4765dd5

Browse files
author
Linus Torvalds
committed
diff.c: don't add extra '/' to pathname
The "base" string already contains any finishing "/", so the way to get the full pathname is to just concatenate the base and path directly, with no extra slashes in between.
1 parent c9cddab commit 4765dd5

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

diff.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ void diff_addremove(int addremove, unsigned mode,
256256

257257
if (path) {
258258
strcpy(concatpath, base);
259-
strcat(concatpath, "/");
260259
strcat(concatpath, path);
261260
}
262261
run_external_diff(path ? concatpath : base, one, two);
@@ -278,7 +277,6 @@ void diff_change(unsigned old_mode, unsigned new_mode,
278277

279278
if (path) {
280279
strcpy(concatpath, base);
281-
strcat(concatpath, "/");
282280
strcat(concatpath, path);
283281
}
284282
run_external_diff(path ? concatpath : base, &spec[0], &spec[1]);

0 commit comments

Comments
 (0)