projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move the warning msg after features.h gets pulled in.
[oweals/busybox.git]
/
cut.c
diff --git
a/cut.c
b/cut.c
index 6e0fe83fc89d42e5e69ee5975c9a22ce7fd7e6fc..7e9a72e3f7ba67eeef659bf544b5afe6f624f4a8 100644
(file)
--- a/
cut.c
+++ b/
cut.c
@@
-1,8
+1,8
@@
/*
* cut.c - minimalist version of cut
*
/*
* cut.c - minimalist version of cut
*
- * Copyright (C) 1999,2000 by Lineo, inc.
- * Written by Mark Whitley <markw@lineo.com>, <markw@
enol.com
>
+ * Copyright (C) 1999,2000
,2001
by Lineo, inc.
+ * Written by Mark Whitley <markw@lineo.com>, <markw@
codepoet.org
>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-54,12
+54,12
@@
static void decompose_list(const char *list)
/* the list must contain only digits and no more than one minus sign */
for (ptr = (char *)list; *ptr; ptr++) {
if (!isdigit(*ptr) && *ptr != '-') {
/* the list must contain only digits and no more than one minus sign */
for (ptr = (char *)list; *ptr; ptr++) {
if (!isdigit(*ptr) && *ptr != '-') {
- error_msg_and_die("invalid byte or field list
\n
");
+ error_msg_and_die("invalid byte or field list");
}
if (*ptr == '-') {
nminus++;
if (nminus > 1) {
}
if (*ptr == '-') {
nminus++;
if (nminus > 1) {
- error_msg_and_die("invalid byte or field list
\n
");
+ error_msg_and_die("invalid byte or field list");
}
}
}
}
}
}
@@
-68,7
+68,7
@@
static void decompose_list(const char *list)
if (nminus == 0) {
startpos = strtol(list, &ptr, 10);
if (startpos == 0) {
if (nminus == 0) {
startpos = strtol(list, &ptr, 10);
if (startpos == 0) {
- error_msg_and_die("missing list of fields
\n
");
+ error_msg_and_die("missing list of fields");
}
endpos = startpos;
}
}
endpos = startpos;
}
@@
-195,7
+195,7
@@
extern int cut_main(int argc, char **argv)
break;
case 'd':
if (strlen(optarg) > 1) {
break;
case 'd':
if (strlen(optarg) > 1) {
- error_msg_and_die("the delimiter must be a single character
\n
");
+ error_msg_and_die("the delimiter must be a single character");
}
delim = optarg[0];
break;
}
delim = optarg[0];
break;
@@
-209,16
+209,17
@@
extern int cut_main(int argc, char **argv)
}
if (part == 0) {
}
if (part == 0) {
- error_msg_and_die("you must specify a list of bytes, characters, or fields
\n
");
+ error_msg_and_die("you must specify a list of bytes, characters, or fields");
}
if (supress_non_delimited_lines && part != 'f') {
}
if (supress_non_delimited_lines && part != 'f') {
- error_msg_and_die("suppressing non-delimited lines makes sense
- only when operating on fields\n");
+ error_msg_and_die("suppressing non-delimited lines makes sense"
+ " only when operating on fields");
+
}
if (delim != '\t' && part != 'f') {
}
if (delim != '\t' && part != 'f') {
- error_msg_and_die("a delimiter may be specified only when operating on fields
\n
");
+ error_msg_and_die("a delimiter may be specified only when operating on fields");
}
/* argv[(optind)..(argc-1)] should be names of file to process. If no
}
/* argv[(optind)..(argc-1)] should be names of file to process. If no
@@
-233,7
+234,7
@@
extern int cut_main(int argc, char **argv)
for (i = optind; i < argc; i++) {
file = fopen(argv[i], "r");
if (file == NULL) {
for (i = optind; i < argc; i++) {
file = fopen(argv[i], "r");
if (file == NULL) {
-
error_msg("%s: %s\n", argv[i], strerror(errno)
);
+
perror_msg("%s", argv[i]
);
} else {
cut_file(file);
fclose(file);
} else {
cut_file(file);
fclose(file);