aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-06-09 12:55:13 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-06-09 12:55:13 +0200
commit38d9072b2c9490e67c3423e09b081754095d8c49 (patch)
tree1fa724b43856df74bb0013e60142ac13db65741e /editors
parent764b2f0ec0b1ac8c7617d732c1a015a9e8598820 (diff)
downloadbusybox-w32-38d9072b2c9490e67c3423e09b081754095d8c49.tar.gz
busybox-w32-38d9072b2c9490e67c3423e09b081754095d8c49.tar.bz2
busybox-w32-38d9072b2c9490e67c3423e09b081754095d8c49.zip
diff: tiny compat tweak
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r--editors/diff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/editors/diff.c b/editors/diff.c
index 00ecdd8c6..e3933e724 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -1298,6 +1298,8 @@ int diff_main(int argc UNUSED_PARAM, char **argv)
1298 */ 1298 */
1299 f1 = argv[0]; 1299 f1 = argv[0];
1300 f2 = argv[1]; 1300 f2 = argv[1];
1301 /* Compat: "diff file name_which_doesnt_exist" exits with 2 */
1302 xfunc_error_retval = 2;
1301 if (LONE_DASH(f1)) { 1303 if (LONE_DASH(f1)) {
1302 fstat(STDIN_FILENO, &stb1); 1304 fstat(STDIN_FILENO, &stb1);
1303 gotstdin++; 1305 gotstdin++;
@@ -1308,6 +1310,7 @@ int diff_main(int argc UNUSED_PARAM, char **argv)
1308 gotstdin++; 1310 gotstdin++;
1309 } else 1311 } else
1310 xstat(f2, &stb2); 1312 xstat(f2, &stb2);
1313 xfunc_error_retval = 1;
1311 1314
1312 if (gotstdin && (S_ISDIR(stb1.st_mode) || S_ISDIR(stb2.st_mode))) 1315 if (gotstdin && (S_ISDIR(stb1.st_mode) || S_ISDIR(stb2.st_mode)))
1313 bb_error_msg_and_die("can't compare stdin to a directory"); 1316 bb_error_msg_and_die("can't compare stdin to a directory");