summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorMatt Kraai2001-01-31 19:00:21 +0000
committerMatt Kraai2001-01-31 19:00:21 +0000
commitdd19c6990496023fe23fefef8f1798740f7d39c6 (patch)
tree3933adefa4171173db78fa2389146ac89f4edb86 /coreutils
parent63ec2732454a0c973305794e185e488106f6b282 (diff)
downloadbusybox-dd19c6990496023fe23fefef8f1798740f7d39c6.zip
busybox-dd19c6990496023fe23fefef8f1798740f7d39c6.tar.gz
Removed trailing \n from error_msg{,_and_die} messages.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cut.c16
-rw-r--r--coreutils/dd.c2
-rw-r--r--coreutils/df.c2
-rw-r--r--coreutils/expr.c20
-rw-r--r--coreutils/id.c2
-rw-r--r--coreutils/logname.c2
-rw-r--r--coreutils/md5sum.c26
-rw-r--r--coreutils/mkdir.c4
-rw-r--r--coreutils/test.c10
-rw-r--r--coreutils/tr.c2
-rw-r--r--coreutils/uudecode.c20
-rw-r--r--coreutils/uuencode.c4
-rw-r--r--coreutils/whoami.c2
13 files changed, 56 insertions, 56 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c
index ed68657..7e9a72e 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -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 != '-') {
- 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) {
- 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) {
- error_msg_and_die("missing list of fields\n");
+ error_msg_and_die("missing list of fields");
}
endpos = startpos;
}
@@ -188,14 +188,14 @@ extern int cut_main(int argc, char **argv)
case 'f':
/* make sure they didn't ask for two types of lists */
if (part != 0) {
- error_msg_and_die("only one type of list may be specified\n");
+ error_msg_and_die("only one type of list may be specified");
}
part = (char)opt;
decompose_list(optarg);
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;
@@ -209,17 +209,17 @@ extern int cut_main(int argc, char **argv)
}
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') {
error_msg_and_die("suppressing non-delimited lines makes sense"
- " only when operating on fields\n");
+ " only when operating on fields");
}
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
diff --git a/coreutils/dd.c b/coreutils/dd.c
index dac9ccd..5823106 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -76,7 +76,7 @@ int dd_main(int argc, char **argv)
sync = TRUE;
buf += 4;
} else {
- error_msg_and_die("invalid conversion `%s'\n", argv[i]+5);
+ error_msg_and_die("invalid conversion `%s'", argv[i]+5);
}
if (buf[0] == '\0')
break;
diff --git a/coreutils/df.c b/coreutils/df.c
index 7a24fed..5591979 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -118,7 +118,7 @@ extern int df_main(int argc, char **argv)
for(i = optind; i < argc; i++)
{
if ((mountEntry = find_mount_point(argv[i], mtab_file)) == 0) {
- error_msg("%s: can't find mount point.\n", argv[i]);
+ error_msg("%s: can't find mount point.", argv[i]);
status = EXIT_FAILURE;
} else if (!df(mountEntry->mnt_fsname, mountEntry->mnt_dir))
status = EXIT_FAILURE;
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 71bd224..8ef5293 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -76,14 +76,14 @@ int expr_main (int argc, char **argv)
VALUE *v;
if (argc == 1) {
- error_msg_and_die("too few arguments\n");
+ error_msg_and_die("too few arguments");
}
args = argv + 1;
v = eval ();
if (*args)
- error_msg_and_die ("syntax error\n");
+ error_msg_and_die ("syntax error");
if (v->type == integer)
printf ("%d\n", v->u.i);
@@ -218,7 +218,7 @@ static \
int name (l, r) VALUE *l; VALUE *r; \
{ \
if (!toarith (l) || !toarith (r)) \
- error_msg_and_die ("non-numeric argument\n"); \
+ error_msg_and_die ("non-numeric argument"); \
return l->u.i op r->u.i; \
}
@@ -226,9 +226,9 @@ int name (l, r) VALUE *l; VALUE *r; \
int name (l, r) VALUE *l; VALUE *r; \
{ \
if (!toarith (l) || !toarith (r)) \
- error_msg_and_die ( "non-numeric argument\n"); \
+ error_msg_and_die ( "non-numeric argument"); \
if (r->u.i == 0) \
- error_msg_and_die ( "division by zero\n"); \
+ error_msg_and_die ( "division by zero"); \
return l->u.i op r->u.i; \
}
@@ -272,7 +272,7 @@ of a basic regular expression is not portable; it is being ignored",
re_syntax_options = RE_SYNTAX_POSIX_BASIC;
errmsg = re_compile_pattern (pv->u.s, len, &re_buffer);
if (errmsg) {
- error_msg_and_die("%s\n", errmsg);
+ error_msg_and_die("%s", errmsg);
}
len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs);
@@ -303,19 +303,19 @@ static VALUE *eval7 (void)
VALUE *v;
if (!*args)
- error_msg_and_die ( "syntax error\n");
+ error_msg_and_die ( "syntax error");
if (nextarg ("(")) {
args++;
v = eval ();
if (!nextarg (")"))
- error_msg_and_die ( "syntax error\n");
+ error_msg_and_die ( "syntax error");
args++;
return v;
}
if (nextarg (")"))
- error_msg_and_die ( "syntax error\n");
+ error_msg_and_die ( "syntax error");
return str_value (*args++);
}
@@ -329,7 +329,7 @@ static VALUE *eval6 (void)
if (nextarg ("quote")) {
args++;
if (!*args)
- error_msg_and_die ( "syntax error\n");
+ error_msg_and_die ( "syntax error");
return str_value (*args++);
}
else if (nextarg ("length")) {
diff --git a/coreutils/id.c b/coreutils/id.c
index e91ac75..650e3db 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -77,7 +77,7 @@ extern int id_main(int argc, char **argv)
pwnam=my_getpwnam(user);
grnam=my_getgrnam(group);
if (gid == -1 || pwnam==-1 || grnam==-1) {
- error_msg_and_die("%s: No such user\n", user);
+ error_msg_and_die("%s: No such user", user);
}
if (no_group) {
diff --git a/coreutils/logname.c b/coreutils/logname.c
index edec016..d9056c6 100644
--- a/coreutils/logname.c
+++ b/coreutils/logname.c
@@ -37,5 +37,5 @@ extern int logname_main(int argc, char **argv)
puts(user);
return EXIT_SUCCESS;
}
- error_msg_and_die("no login name\n");
+ error_msg_and_die("no login name");
}
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c
index ad40780..97a9400 100644
--- a/coreutils/md5sum.c
+++ b/coreutils/md5sum.c
@@ -719,7 +719,7 @@ static int md5_check(const char *checkfile_name)
if (split_3(line, line_length, &md5num, &binary, &filename)
|| !hex_digits(md5num)) {
if (warn) {
- error_msg("%s: %lu: improperly formatted MD5 checksum line\n",
+ error_msg("%s: %lu: improperly formatted MD5 checksum line",
checkfile_name, (unsigned long) line_number);
}
} else {
@@ -764,7 +764,7 @@ static int md5_check(const char *checkfile_name)
while (!feof(checkfile_stream) && !ferror(checkfile_stream));
if (ferror(checkfile_stream)) {
- error_msg("%s: read error\n", checkfile_name); /* */
+ error_msg("%s: read error", checkfile_name);
return FALSE;
}
@@ -775,7 +775,7 @@ static int md5_check(const char *checkfile_name)
if (n_properly_formated_lines == 0) {
/* Warn if no tests are found. */
- error_msg("%s: no properly formatted MD5 checksum lines found\n",
+ error_msg("%s: no properly formatted MD5 checksum lines found",
checkfile_name);
return FALSE;
} else {
@@ -784,13 +784,13 @@ static int md5_check(const char *checkfile_name)
- n_open_or_read_failures);
if (n_open_or_read_failures > 0) {
- error_msg("WARNING: %d of %d listed files could not be read\n",
+ error_msg("WARNING: %d of %d listed files could not be read",
n_open_or_read_failures, n_properly_formated_lines);
return FALSE;
}
if (n_mismatched_checksums > 0) {
- error_msg("WARNING: %d of %d computed checksums did NOT match\n",
+ error_msg("WARNING: %d of %d computed checksums did NOT match",
n_mismatched_checksums, n_computed_checkums);
return FALSE;
}
@@ -855,26 +855,26 @@ int md5sum_main(int argc,
}
if (file_type_specified && do_check) {
- error_msg_and_die("the -b and -t options are meaningless when verifying checksums\n");
+ error_msg_and_die("the -b and -t options are meaningless when verifying checksums");
}
if (n_strings > 0 && do_check) {
- error_msg_and_die("the -g and -c options are mutually exclusive\n");
+ error_msg_and_die("the -g and -c options are mutually exclusive");
}
if (status_only && !do_check) {
- error_msg_and_die("the -s option is meaningful only when verifying checksums\n");
+ error_msg_and_die("the -s option is meaningful only when verifying checksums");
}
if (warn && !do_check) {
- error_msg_and_die("the -w option is meaningful only when verifying checksums\n");
+ error_msg_and_die("the -w option is meaningful only when verifying checksums");
}
if (n_strings > 0) {
size_t i;
if (optind < argc) {
- error_msg_and_die("no files may be specified when using -g\n");
+ error_msg_and_die("no files may be specified when using -g");
}
for (i = 0; i < n_strings; ++i) {
size_t cnt;
@@ -887,7 +887,7 @@ int md5sum_main(int argc,
}
} else if (do_check) {
if (optind + 1 < argc) {
- error_msg("only one argument may be specified when using -c\n");
+ error_msg("only one argument may be specified when using -c");
}
err = md5_check ((optind == argc) ? "-" : argv[optind]);
@@ -940,11 +940,11 @@ int md5sum_main(int argc,
}
if (fclose (stdout) == EOF) {
- error_msg_and_die("write error\n");
+ error_msg_and_die("write error");
}
if (have_read_stdin && fclose (stdin) == EOF) {
- error_msg_and_die("standard input\n");
+ error_msg_and_die("standard input");
}
if (err == 0)
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 07b1871..299f298 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -52,7 +52,7 @@ extern int mkdir_main(int argc, char **argv)
/* Find the specified modes */
mode = 0;
if (parse_mode(*(++argv), &mode) == FALSE) {
- error_msg_and_die("Unknown mode: %s\n", *argv);
+ error_msg_and_die("Unknown mode: %s", *argv);
}
/* Set the umask for this process so it doesn't
* screw up whatever the user just entered. */
@@ -85,7 +85,7 @@ extern int mkdir_main(int argc, char **argv)
strcpy(buf, *argv);
status = stat(buf, &statBuf);
if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
- error_msg_and_die("%s: File exists\n", buf);
+ error_msg_and_die("%s: File exists", buf);
}
if (parentFlag == TRUE) {
strcat(buf, "/");
diff --git a/coreutils/test.c b/coreutils/test.c
index ba6feb0..6439e3a 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -184,7 +184,7 @@ test_main(int argc, char** argv)
if (strcmp(applet_name, "[") == 0) {
if (strcmp(argv[--argc], "]"))
- error_msg_and_die("missing ]\n");
+ error_msg_and_die("missing ]");
argv[argc] = NULL;
}
/* Implement special cases from POSIX.2, section 4.62.4 */
@@ -233,9 +233,9 @@ syntax(op, msg)
char *msg;
{
if (op && *op)
- error_msg_and_die("%s: %s\n", op, msg);
+ error_msg_and_die("%s: %s", op, msg);
else
- error_msg_and_die("%s\n", msg);
+ error_msg_and_die("%s", msg);
}
static int
@@ -470,13 +470,13 @@ getn(s)
r = strtol(s, &p, 10);
if (errno != 0)
- error_msg_and_die("%s: out of range\n", s);
+ error_msg_and_die("%s: out of range", s);
while (isspace(*p))
p++;
if (*p)
- error_msg_and_die("%s: bad number\n", s);
+ error_msg_and_die("%s: bad number", s);
return (int) r;
}
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 2717a92..36f29de 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -186,7 +186,7 @@ extern int tr_main(int argc, char **argv)
input_length = complement(input, input_length);
if (argv[index] != NULL) {
if (*argv[index] == '\0')
- error_msg_and_die("STRING2 cannot be empty\n");
+ error_msg_and_die("STRING2 cannot be empty");
output_length = expand(argv[index], output);
map(input, input_length, output, output_length);
}
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index fcfcfd9..cccc528 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -46,7 +46,7 @@ static int read_stduu (const char *inname)
char *p;
if (fgets (buf, sizeof(buf), stdin) == NULL) {
- error_msg("%s: Short file\n", inname);
+ error_msg("%s: Short file", inname);
return FALSE;
}
p = buf;
@@ -81,7 +81,7 @@ static int read_stduu (const char *inname)
if (fgets (buf, sizeof(buf), stdin) == NULL
|| strcmp (buf, "end\n")) {
- error_msg("%s: No `end' line\n", inname);
+ error_msg("%s: No `end' line", inname);
return FALSE;
}
@@ -131,7 +131,7 @@ static int read_base64 (const char *inname)
unsigned char *p;
if (fgets (buf, sizeof(buf), stdin) == NULL) {
- error_msg("%s: Short file\n", inname);
+ error_msg("%s: Short file", inname);
return FALSE;
}
p = buf;
@@ -139,7 +139,7 @@ static int read_base64 (const char *inname)
if (memcmp (buf, "====", 4) == 0)
break;
if (last_data != 0) {
- error_msg("%s: data following `=' padding character\n", inname);
+ error_msg("%s: data following `=' padding character", inname);
return FALSE;
}
@@ -161,14 +161,14 @@ static int read_base64 (const char *inname)
while ((b64_tab[*p] & '\100') != 0)
if (*p == '\n' || *p++ == '=') {
- error_msg("%s: illegal line\n", inname);
+ error_msg("%s: illegal line", inname);
return FALSE;
}
c2 = b64_tab[*p++];
while (b64_tab[*p] == '\177')
if (*p++ == '\n') {
- error_msg("%s: illegal line\n", inname);
+ error_msg("%s: illegal line", inname);
return FALSE;
}
if (*p == '=') {
@@ -180,7 +180,7 @@ static int read_base64 (const char *inname)
while (b64_tab[*p] == '\177')
if (*p++ == '\n') {
- error_msg("%s: illegal line\n", inname);
+ error_msg("%s: illegal line", inname);
return FALSE;
}
putchar (c1 << 2 | c2 >> 4);
@@ -212,7 +212,7 @@ static int decode (const char *inname,
while (1) {
if (fgets (buf, sizeof (buf), stdin) == NULL) {
- error_msg("%s: No `begin' line\n", inname);
+ error_msg("%s: No `begin' line", inname);
return FALSE;
}
@@ -237,13 +237,13 @@ static int decode (const char *inname,
while (*p != '/')
++p;
if (*p == '\0') {
- error_msg("%s: Illegal ~user\n", inname);
+ error_msg("%s: Illegal ~user", inname);
return FALSE;
}
*p++ = '\0';
pw = getpwnam (buf + 1);
if (pw == NULL) {
- error_msg("%s: No user `%s'\n", inname, buf + 1);
+ error_msg("%s: No user `%s'", inname, buf + 1);
return FALSE;
}
n = strlen (pw->pw_dir);
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index 5df4902..73098ba 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -142,7 +142,7 @@ static void encode()
}
if (ferror (stdin))
- error_msg("Read error\n");
+ error_msg("Read error");
if (trans_ptr == uu_std) {
putchar (ENC ('\0'));
@@ -196,7 +196,7 @@ int uuencode_main (int argc,
encode();
printf(trans_ptr == uu_std ? "end\n" : "====\n");
if (ferror (stdout)) {
- error_msg("Write error\n");
+ error_msg("Write error");
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
diff --git a/coreutils/whoami.c b/coreutils/whoami.c
index 870ede4..398e373 100644
--- a/coreutils/whoami.c
+++ b/coreutils/whoami.c
@@ -38,5 +38,5 @@ extern int whoami_main(int argc, char **argv)
puts(user);
return EXIT_SUCCESS;
}
- error_msg_and_die("cannot find username for UID %u\n", (unsigned) uid);
+ error_msg_and_die("cannot find username for UID %u", (unsigned) uid);
}