diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2012-09-17 23:31:08 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@linbit.com> | 2012-09-18 00:48:01 +0200 |
commit | 4c7c0976ac8743d0b934b07f59ba9448a76dbac1 (patch) | |
tree | 82429e7a231b88fb8109930568db60367b751995 | |
parent | 95f6823325069467d437c258b2246529c550714d (diff) | |
download | patch-4c7c0976ac8743d0b934b07f59ba9448a76dbac1.tar.gz |
Improve error message when patching a file of different type
* src/inp.c (get_input_file): Improve error message when patching a file of
different type.
* tests/symlinks: Update test case.
-rw-r--r-- | src/inp.c | 2 | ||||
-rw-r--r-- | tests/symlinks | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -198,7 +198,7 @@ get_input_file (char const *filename, char const *outname, mode_t mode) else if (! ((S_ISREG (mode) || S_ISLNK (mode)) && (mode & S_IFMT) == (instat.st_mode & S_IFMT))) { - say ("File %s is not a %s -- can't patch\n", + say ("File %s is not a %s -- refusing to patch\n", quotearg (filename), S_ISLNK (mode) ? "symbolic link" : "regular file"); return false; diff --git a/tests/symlinks b/tests/symlinks index f21a76d..5f7595d 100644 --- a/tests/symlinks +++ b/tests/symlinks @@ -26,7 +26,7 @@ echo one > f ncheck 'ln -s f l' check 'patch < create.diff || echo "Status: $?"' <<EOF -File l is not a regular file -- can't patch +File l is not a regular file -- refusing to patch 1 out of 1 hunk ignored -- saving rejects to file l.rej Status: 1 EOF @@ -50,7 +50,7 @@ cat > modify.diff <<EOF EOF check 'patch < modify.diff || echo "Status: $?"' <<EOF -File l is not a regular file -- can't patch +File l is not a regular file -- refusing to patch 1 out of 1 hunk ignored -- saving rejects to file l.rej Status: 1 EOF @@ -68,7 +68,7 @@ cat > delete.diff <<EOF EOF check 'patch < delete.diff || echo "Status: $?"' <<EOF -File l is not a regular file -- can't patch +File l is not a regular file -- refusing to patch 1 out of 1 hunk ignored -- saving rejects to file l.rej Status: 1 EOF |