Skip to content

Commit

Permalink
diff.c: don't add extra '/' to pathname
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Linus Torvalds committed Apr 27, 2005
1 parent c9cddab commit 4765dd5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ void diff_addremove(int addremove, unsigned mode,

if (path) {
strcpy(concatpath, base);
strcat(concatpath, "/");
strcat(concatpath, path);
}
run_external_diff(path ? concatpath : base, one, two);
Expand All @@ -278,7 +277,6 @@ void diff_change(unsigned old_mode, unsigned new_mode,

if (path) {
strcpy(concatpath, base);
strcat(concatpath, "/");
strcat(concatpath, path);
}
run_external_diff(path ? concatpath : base, &spec[0], &spec[1]);
Expand Down

0 comments on commit 4765dd5

Please sign in to comment.