diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-16 23:49:13 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-16 23:49:13 +0000 |
commit | 8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9 (patch) | |
tree | 6dc013e44d2281eb1e6f61c4bca1ae7546001f79 /coreutils/diff.c | |
parent | b0ba03e9b3d460154fd09ef5676c18bf0770fdce (diff) | |
download | busybox-w32-8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9.tar.gz busybox-w32-8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9.tar.bz2 busybox-w32-8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9.zip |
inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid]
git-svn-id: svn://busybox.net/trunk/busybox@16977 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/diff.c')
-rw-r--r-- | coreutils/diff.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/coreutils/diff.c b/coreutils/diff.c index 0df9989b7..887679a0a 100644 --- a/coreutils/diff.c +++ b/coreutils/diff.c | |||
@@ -904,19 +904,19 @@ static int diffreg(char *ofile1, char *ofile2, int flags) | |||
904 | 904 | ||
905 | if (S_ISDIR(stb1.st_mode) != S_ISDIR(stb2.st_mode)) | 905 | if (S_ISDIR(stb1.st_mode) != S_ISDIR(stb2.st_mode)) |
906 | return (S_ISDIR(stb1.st_mode) ? D_MISMATCH1 : D_MISMATCH2); | 906 | return (S_ISDIR(stb1.st_mode) ? D_MISMATCH1 : D_MISMATCH2); |
907 | if (strcmp(file1, "-") == 0 && strcmp(file2, "-") == 0) | 907 | if (LONE_DASH(file1) && LONE_DASH(file2)) |
908 | goto closem; | 908 | goto closem; |
909 | 909 | ||
910 | f1 = stdin; | 910 | f1 = stdin; |
911 | if (flags & D_EMPTY1) | 911 | if (flags & D_EMPTY1) |
912 | f1 = xfopen(bb_dev_null, "r"); | 912 | f1 = xfopen(bb_dev_null, "r"); |
913 | else if (file1[0] != '-' || file1[1]) /* not "-" */ | 913 | else if (NOT_LONE_DASH(file1)) |
914 | f1 = xfopen(file1, "r"); | 914 | f1 = xfopen(file1, "r"); |
915 | 915 | ||
916 | f2 = stdin; | 916 | f2 = stdin; |
917 | if (flags & D_EMPTY2) | 917 | if (flags & D_EMPTY2) |
918 | f2 = xfopen(bb_dev_null, "r"); | 918 | f2 = xfopen(bb_dev_null, "r"); |
919 | else if (file2[0] != '-' || file2[1]) /* not "-" */ | 919 | else if (NOT_LONE_DASH(file2)) |
920 | f2 = xfopen(file2, "r"); | 920 | f2 = xfopen(file2, "r"); |
921 | 921 | ||
922 | i = files_differ(f1, f2, flags); | 922 | i = files_differ(f1, f2, flags); |
@@ -1212,12 +1212,12 @@ int diff_main(int argc, char **argv) | |||
1212 | bb_error_msg("missing filename"); | 1212 | bb_error_msg("missing filename"); |
1213 | bb_show_usage(); | 1213 | bb_show_usage(); |
1214 | } | 1214 | } |
1215 | if (argv[0][0] == '-' && !argv[0][1]) { /* "-" */ | 1215 | if (LONE_DASH(argv[0])) { |
1216 | fstat(STDIN_FILENO, &stb1); | 1216 | fstat(STDIN_FILENO, &stb1); |
1217 | gotstdin = 1; | 1217 | gotstdin = 1; |
1218 | } else | 1218 | } else |
1219 | xstat(argv[0], &stb1); | 1219 | xstat(argv[0], &stb1); |
1220 | if (argv[1][0] == '-' && !argv[1][1]) { /* "-" */ | 1220 | if (LONE_DASH(argv[1])) { |
1221 | fstat(STDIN_FILENO, &stb2); | 1221 | fstat(STDIN_FILENO, &stb2); |
1222 | gotstdin = 1; | 1222 | gotstdin = 1; |
1223 | } else | 1223 | } else |