aboutsummaryrefslogtreecommitdiff
path: root/coreutils/diff.c
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-06-07 20:17:41 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-06-07 20:17:41 +0000
commitf4532f9fd377898c339aaa81cde66c14808248dd (patch)
tree6e35288c247102998a775cbc16f9ec014e00e7fd /coreutils/diff.c
parent2ce533f0b2a79abdfb07d8879afe08f697278158 (diff)
downloadbusybox-w32-f4532f9fd377898c339aaa81cde66c14808248dd.tar.gz
busybox-w32-f4532f9fd377898c339aaa81cde66c14808248dd.tar.bz2
busybox-w32-f4532f9fd377898c339aaa81cde66c14808248dd.zip
- reuse strings and messages. Saves about 600B
git-svn-id: svn://busybox.net/trunk/busybox@15325 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r--coreutils/diff.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/coreutils/diff.c b/coreutils/diff.c
index 57b32eb78..786e2a8ab 100644
--- a/coreutils/diff.c
+++ b/coreutils/diff.c
@@ -1158,7 +1158,7 @@ static void diffdir(char *p1, char *p2)
1158 while (*dirlist2 != NULL && strcmp(*dirlist2, start) < 0) 1158 while (*dirlist2 != NULL && strcmp(*dirlist2, start) < 0)
1159 dirlist2++; 1159 dirlist2++;
1160 if ((*dirlist1 == NULL) || (*dirlist2 == NULL)) 1160 if ((*dirlist1 == NULL) || (*dirlist2 == NULL))
1161 bb_error_msg("Invalid argument to -S"); 1161 bb_error_msg(bb_msg_invalid_arg, "NULL", "-S");
1162 } 1162 }
1163 1163
1164 /* Now that both dirlist1 and dirlist2 contain sorted directory 1164 /* Now that both dirlist1 and dirlist2 contain sorted directory
@@ -1194,7 +1194,6 @@ static void diffdir(char *p1, char *p2)
1194 1194
1195int diff_main(int argc, char **argv) 1195int diff_main(int argc, char **argv)
1196{ 1196{
1197 char *ep;
1198 int gotstdin = 0; 1197 int gotstdin = 0;
1199 1198
1200 char *U_opt; 1199 char *U_opt;
@@ -1229,11 +1228,7 @@ int diff_main(int argc, char **argv)
1229 1228
1230 context = 3; /* This is the default number of lines of context. */ 1229 context = 3; /* This is the default number of lines of context. */
1231 if (cmd_flags & FLAG_U) { 1230 if (cmd_flags & FLAG_U) {
1232 context = strtol(U_opt, &ep, 10); 1231 context = bb_xgetlarg(U_opt, 10, 1, INT_MAX);
1233 if (context == 0) {
1234 bb_error_msg("Invalid context length");
1235 bb_show_usage();
1236 }
1237 } 1232 }
1238 argc -= optind; 1233 argc -= optind;
1239 argv += optind; 1234 argv += optind;