projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
764b2f0
)
diff: tiny compat tweak
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 9 Jun 2009 10:55:13 +0000
(12:55 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 9 Jun 2009 10:55:13 +0000
(12:55 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
editors/diff.c
patch
|
blob
|
history
diff --git
a/editors/diff.c
b/editors/diff.c
index 00ecdd8c60055d0dc1cb1f006ba4226f18f30048..e3933e72424cc22ada27a9a76227e10e0431ac60 100644
(file)
--- a/
editors/diff.c
+++ b/
editors/diff.c
@@
-1298,6
+1298,8
@@
int diff_main(int argc UNUSED_PARAM, char **argv)
*/
f1 = argv[0];
f2 = argv[1];
+ /* Compat: "diff file name_which_doesnt_exist" exits with 2 */
+ xfunc_error_retval = 2;
if (LONE_DASH(f1)) {
fstat(STDIN_FILENO, &stb1);
gotstdin++;
@@
-1308,6
+1310,7
@@
int diff_main(int argc UNUSED_PARAM, char **argv)
gotstdin++;
} else
xstat(f2, &stb2);
+ xfunc_error_retval = 1;
if (gotstdin && (S_ISDIR(stb1.st_mode) || S_ISDIR(stb2.st_mode)))
bb_error_msg_and_die("can't compare stdin to a directory");