diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/ed.c | 66 | ||||
-rw-r--r-- | editors/sed.c | 2 |
2 files changed, 34 insertions, 34 deletions
diff --git a/editors/ed.c b/editors/ed.c index 1ff93c2bb..190c547f4 100644 --- a/editors/ed.c +++ b/editors/ed.c | |||
@@ -57,7 +57,7 @@ int ed_main(int argc, char **argv) | |||
57 | fileName = strdup(argv[1]); | 57 | fileName = strdup(argv[1]); |
58 | 58 | ||
59 | if (fileName == NULL) { | 59 | if (fileName == NULL) { |
60 | bb_error_msg("No memory"); | 60 | bb_error_msg("no memory"); |
61 | termEdit(); | 61 | termEdit(); |
62 | return EXIT_SUCCESS; | 62 | return EXIT_SUCCESS; |
63 | } | 63 | } |
@@ -105,7 +105,7 @@ static void doCommands(void) | |||
105 | 105 | ||
106 | if (*endbuf != '\n') | 106 | if (*endbuf != '\n') |
107 | { | 107 | { |
108 | bb_error_msg("Command line too long"); | 108 | bb_error_msg("command line too long"); |
109 | 109 | ||
110 | do | 110 | do |
111 | { | 111 | { |
@@ -182,7 +182,7 @@ static void doCommands(void) | |||
182 | case 'f': | 182 | case 'f': |
183 | if (*cp && !isblank(*cp)) | 183 | if (*cp && !isblank(*cp)) |
184 | { | 184 | { |
185 | bb_error_msg("Bad file command"); | 185 | bb_error_msg("bad file command"); |
186 | break; | 186 | break; |
187 | } | 187 | } |
188 | 188 | ||
@@ -203,7 +203,7 @@ static void doCommands(void) | |||
203 | 203 | ||
204 | if (newname == NULL) | 204 | if (newname == NULL) |
205 | { | 205 | { |
206 | bb_error_msg("No memory for file name"); | 206 | bb_error_msg("no memory for file name"); |
207 | break; | 207 | break; |
208 | } | 208 | } |
209 | 209 | ||
@@ -223,7 +223,7 @@ static void doCommands(void) | |||
223 | 223 | ||
224 | if ((*cp < 'a') || (*cp > 'a') || cp[1]) | 224 | if ((*cp < 'a') || (*cp > 'a') || cp[1]) |
225 | { | 225 | { |
226 | bb_error_msg("Bad mark name"); | 226 | bb_error_msg("bad mark name"); |
227 | break; | 227 | break; |
228 | } | 228 | } |
229 | 229 | ||
@@ -244,7 +244,7 @@ static void doCommands(void) | |||
244 | 244 | ||
245 | if (have1 || *cp) | 245 | if (have1 || *cp) |
246 | { | 246 | { |
247 | bb_error_msg("Bad quit command"); | 247 | bb_error_msg("bad quit command"); |
248 | break; | 248 | break; |
249 | } | 249 | } |
250 | 250 | ||
@@ -269,7 +269,7 @@ static void doCommands(void) | |||
269 | case 'r': | 269 | case 'r': |
270 | if (*cp && !isblank(*cp)) | 270 | if (*cp && !isblank(*cp)) |
271 | { | 271 | { |
272 | bb_error_msg("Bad read command"); | 272 | bb_error_msg("bad read command"); |
273 | break; | 273 | break; |
274 | } | 274 | } |
275 | 275 | ||
@@ -278,7 +278,7 @@ static void doCommands(void) | |||
278 | 278 | ||
279 | if (*cp == '\0') | 279 | if (*cp == '\0') |
280 | { | 280 | { |
281 | bb_error_msg("No file name"); | 281 | bb_error_msg("no file name"); |
282 | break; | 282 | break; |
283 | } | 283 | } |
284 | 284 | ||
@@ -300,7 +300,7 @@ static void doCommands(void) | |||
300 | case 'w': | 300 | case 'w': |
301 | if (*cp && !isblank(*cp)) | 301 | if (*cp && !isblank(*cp)) |
302 | { | 302 | { |
303 | bb_error_msg("Bad write command"); | 303 | bb_error_msg("bad write command"); |
304 | break; | 304 | break; |
305 | } | 305 | } |
306 | 306 | ||
@@ -317,7 +317,7 @@ static void doCommands(void) | |||
317 | 317 | ||
318 | if (cp == NULL) | 318 | if (cp == NULL) |
319 | { | 319 | { |
320 | bb_error_msg("No file name specified"); | 320 | bb_error_msg("no file name specified"); |
321 | break; | 321 | break; |
322 | } | 322 | } |
323 | 323 | ||
@@ -342,7 +342,7 @@ static void doCommands(void) | |||
342 | case '.': | 342 | case '.': |
343 | if (have1) | 343 | if (have1) |
344 | { | 344 | { |
345 | bb_error_msg("No arguments allowed"); | 345 | bb_error_msg("no arguments allowed"); |
346 | break; | 346 | break; |
347 | } | 347 | } |
348 | 348 | ||
@@ -372,7 +372,7 @@ static void doCommands(void) | |||
372 | break; | 372 | break; |
373 | 373 | ||
374 | default: | 374 | default: |
375 | bb_error_msg("Unimplemented command"); | 375 | bb_error_msg("unimplemented command"); |
376 | break; | 376 | break; |
377 | } | 377 | } |
378 | } | 378 | } |
@@ -392,7 +392,7 @@ static void subCommand(const char * cmd, int num1, int num2) | |||
392 | 392 | ||
393 | if ((num1 < 1) || (num2 > lastNum) || (num1 > num2)) | 393 | if ((num1 < 1) || (num2 > lastNum) || (num1 > num2)) |
394 | { | 394 | { |
395 | bb_error_msg("Bad line range for substitute"); | 395 | bb_error_msg("bad line range for substitute"); |
396 | 396 | ||
397 | return; | 397 | return; |
398 | } | 398 | } |
@@ -410,7 +410,7 @@ static void subCommand(const char * cmd, int num1, int num2) | |||
410 | 410 | ||
411 | if (isblank(*cp) || (*cp == '\0')) | 411 | if (isblank(*cp) || (*cp == '\0')) |
412 | { | 412 | { |
413 | bb_error_msg("Bad delimiter for substitute"); | 413 | bb_error_msg("bad delimiter for substitute"); |
414 | 414 | ||
415 | return; | 415 | return; |
416 | } | 416 | } |
@@ -422,7 +422,7 @@ static void subCommand(const char * cmd, int num1, int num2) | |||
422 | 422 | ||
423 | if (cp == NULL) | 423 | if (cp == NULL) |
424 | { | 424 | { |
425 | bb_error_msg("Missing 2nd delimiter for substitute"); | 425 | bb_error_msg("missing 2nd delimiter for substitute"); |
426 | 426 | ||
427 | return; | 427 | return; |
428 | } | 428 | } |
@@ -448,7 +448,7 @@ static void subCommand(const char * cmd, int num1, int num2) | |||
448 | break; | 448 | break; |
449 | 449 | ||
450 | default: | 450 | default: |
451 | bb_error_msg("Unknown option for substitute"); | 451 | bb_error_msg("unknown option for substitute"); |
452 | 452 | ||
453 | return; | 453 | return; |
454 | } | 454 | } |
@@ -457,7 +457,7 @@ static void subCommand(const char * cmd, int num1, int num2) | |||
457 | { | 457 | { |
458 | if (searchString[0] == '\0') | 458 | if (searchString[0] == '\0') |
459 | { | 459 | { |
460 | bb_error_msg("No previous search string"); | 460 | bb_error_msg("no previous search string"); |
461 | 461 | ||
462 | return; | 462 | return; |
463 | } | 463 | } |
@@ -545,7 +545,7 @@ static void subCommand(const char * cmd, int num1, int num2) | |||
545 | 545 | ||
546 | if (nlp == NULL) | 546 | if (nlp == NULL) |
547 | { | 547 | { |
548 | bb_error_msg("Cannot get memory for line"); | 548 | bb_error_msg("cannot get memory for line"); |
549 | 549 | ||
550 | return; | 550 | return; |
551 | } | 551 | } |
@@ -587,7 +587,7 @@ static void subCommand(const char * cmd, int num1, int num2) | |||
587 | } | 587 | } |
588 | 588 | ||
589 | if (!didSub) | 589 | if (!didSub) |
590 | bb_error_msg("No substitutions found for \"%s\"", oldStr); | 590 | bb_error_msg("no substitutions found for \"%s\"", oldStr); |
591 | } | 591 | } |
592 | 592 | ||
593 | 593 | ||
@@ -651,7 +651,7 @@ static void addLines(int num) | |||
651 | 651 | ||
652 | if (buf[len - 1] != '\n') | 652 | if (buf[len - 1] != '\n') |
653 | { | 653 | { |
654 | bb_error_msg("Line too long"); | 654 | bb_error_msg("line too long"); |
655 | 655 | ||
656 | do | 656 | do |
657 | { | 657 | { |
@@ -711,7 +711,7 @@ static int getNum(const char **retcp, int *retHaveNum, int *retNum) | |||
711 | 711 | ||
712 | if ((*cp < 'a') || (*cp > 'z')) | 712 | if ((*cp < 'a') || (*cp > 'z')) |
713 | { | 713 | { |
714 | bb_error_msg("Bad mark name"); | 714 | bb_error_msg("bad mark name"); |
715 | 715 | ||
716 | return FALSE; | 716 | return FALSE; |
717 | } | 717 | } |
@@ -799,7 +799,7 @@ static int initEdit(void) | |||
799 | 799 | ||
800 | if (bufBase == NULL) | 800 | if (bufBase == NULL) |
801 | { | 801 | { |
802 | bb_error_msg("No memory for buffer"); | 802 | bb_error_msg("no memory for buffer"); |
803 | 803 | ||
804 | return FALSE; | 804 | return FALSE; |
805 | } | 805 | } |
@@ -865,7 +865,7 @@ static int readLines(const char * file, int num) | |||
865 | 865 | ||
866 | if ((num < 1) || (num > lastNum + 1)) | 866 | if ((num < 1) || (num > lastNum + 1)) |
867 | { | 867 | { |
868 | bb_error_msg("Bad line for read"); | 868 | bb_error_msg("bad line for read"); |
869 | 869 | ||
870 | return FALSE; | 870 | return FALSE; |
871 | } | 871 | } |
@@ -925,7 +925,7 @@ static int readLines(const char * file, int num) | |||
925 | 925 | ||
926 | if (cp == NULL) | 926 | if (cp == NULL) |
927 | { | 927 | { |
928 | bb_error_msg("No memory for buffer"); | 928 | bb_error_msg("no memory for buffer"); |
929 | close(fd); | 929 | close(fd); |
930 | 930 | ||
931 | return FALSE; | 931 | return FALSE; |
@@ -984,7 +984,7 @@ static int writeLines(const char * file, int num1, int num2) | |||
984 | 984 | ||
985 | if ((num1 < 1) || (num2 > lastNum) || (num1 > num2)) | 985 | if ((num1 < 1) || (num2 > lastNum) || (num1 > num2)) |
986 | { | 986 | { |
987 | bb_error_msg("Bad line range for write"); | 987 | bb_error_msg("bad line range for write"); |
988 | 988 | ||
989 | return FALSE; | 989 | return FALSE; |
990 | } | 990 | } |
@@ -1054,7 +1054,7 @@ static int printLines(int num1, int num2, int expandFlag) | |||
1054 | 1054 | ||
1055 | if ((num1 < 1) || (num2 > lastNum) || (num1 > num2)) | 1055 | if ((num1 < 1) || (num2 > lastNum) || (num1 > num2)) |
1056 | { | 1056 | { |
1057 | bb_error_msg("Bad line range for print"); | 1057 | bb_error_msg("bad line range for print"); |
1058 | 1058 | ||
1059 | return FALSE; | 1059 | return FALSE; |
1060 | } | 1060 | } |
@@ -1133,7 +1133,7 @@ static int insertLine(int num, const char * data, int len) | |||
1133 | 1133 | ||
1134 | if ((num < 1) || (num > lastNum + 1)) | 1134 | if ((num < 1) || (num > lastNum + 1)) |
1135 | { | 1135 | { |
1136 | bb_error_msg("Inserting at bad line number"); | 1136 | bb_error_msg("inserting at bad line number"); |
1137 | 1137 | ||
1138 | return FALSE; | 1138 | return FALSE; |
1139 | } | 1139 | } |
@@ -1142,7 +1142,7 @@ static int insertLine(int num, const char * data, int len) | |||
1142 | 1142 | ||
1143 | if (newLp == NULL) | 1143 | if (newLp == NULL) |
1144 | { | 1144 | { |
1145 | bb_error_msg("Failed to allocate memory for line"); | 1145 | bb_error_msg("failed to allocate memory for line"); |
1146 | 1146 | ||
1147 | return FALSE; | 1147 | return FALSE; |
1148 | } | 1148 | } |
@@ -1186,7 +1186,7 @@ static int deleteLines(int num1, int num2) | |||
1186 | 1186 | ||
1187 | if ((num1 < 1) || (num2 > lastNum) || (num1 > num2)) | 1187 | if ((num1 < 1) || (num2 > lastNum) || (num1 > num2)) |
1188 | { | 1188 | { |
1189 | bb_error_msg("Bad line numbers for delete"); | 1189 | bb_error_msg("bad line numbers for delete"); |
1190 | 1190 | ||
1191 | return FALSE; | 1191 | return FALSE; |
1192 | } | 1192 | } |
@@ -1246,7 +1246,7 @@ static int searchLines(const char *str, int num1, int num2) | |||
1246 | 1246 | ||
1247 | if ((num1 < 1) || (num2 > lastNum) || (num1 > num2)) | 1247 | if ((num1 < 1) || (num2 > lastNum) || (num1 > num2)) |
1248 | { | 1248 | { |
1249 | bb_error_msg("Bad line numbers for search"); | 1249 | bb_error_msg("bad line numbers for search"); |
1250 | 1250 | ||
1251 | return 0; | 1251 | return 0; |
1252 | } | 1252 | } |
@@ -1255,7 +1255,7 @@ static int searchLines(const char *str, int num1, int num2) | |||
1255 | { | 1255 | { |
1256 | if (searchString[0] == '\0') | 1256 | if (searchString[0] == '\0') |
1257 | { | 1257 | { |
1258 | bb_error_msg("No previous search string"); | 1258 | bb_error_msg("no previous search string"); |
1259 | 1259 | ||
1260 | return 0; | 1260 | return 0; |
1261 | } | 1261 | } |
@@ -1282,7 +1282,7 @@ static int searchLines(const char *str, int num1, int num2) | |||
1282 | lp = lp->next; | 1282 | lp = lp->next; |
1283 | } | 1283 | } |
1284 | 1284 | ||
1285 | bb_error_msg("Cannot find string \"%s\"", str); | 1285 | bb_error_msg("cannot find string \"%s\"", str); |
1286 | 1286 | ||
1287 | return 0; | 1287 | return 0; |
1288 | } | 1288 | } |
@@ -1298,7 +1298,7 @@ static LINE *findLine(int num) | |||
1298 | 1298 | ||
1299 | if ((num < 1) || (num > lastNum)) | 1299 | if ((num < 1) || (num > lastNum)) |
1300 | { | 1300 | { |
1301 | bb_error_msg("Line number %d does not exist", num); | 1301 | bb_error_msg("line number %d does not exist", num); |
1302 | 1302 | ||
1303 | return NULL; | 1303 | return NULL; |
1304 | } | 1304 | } |
diff --git a/editors/sed.c b/editors/sed.c index 65ca5606b..a16023945 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -610,7 +610,7 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line) | |||
610 | if (sed_cmd->sub_match == NULL) { | 610 | if (sed_cmd->sub_match == NULL) { |
611 | current_regex = bbg.previous_regex_ptr; | 611 | current_regex = bbg.previous_regex_ptr; |
612 | if (!current_regex) | 612 | if (!current_regex) |
613 | bb_error_msg_and_die("No previous regexp."); | 613 | bb_error_msg_and_die("no previous regexp"); |
614 | } else | 614 | } else |
615 | bbg.previous_regex_ptr = current_regex = sed_cmd->sub_match; | 615 | bbg.previous_regex_ptr = current_regex = sed_cmd->sub_match; |
616 | 616 | ||