aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-01-31 19:00:21 +0000
committerMatt Kraai <kraai@debian.org>2001-01-31 19:00:21 +0000
commitdd19c6990496023fe23fefef8f1798740f7d39c6 (patch)
tree3933adefa4171173db78fa2389146ac89f4edb86 /archival
parent63ec2732454a0c973305794e185e488106f6b282 (diff)
downloadbusybox-dd19c6990496023fe23fefef8f1798740f7d39c6.tar.gz
Removed trailing \n from error_msg{,_and_die} messages.
Diffstat (limited to 'archival')
-rw-r--r--archival/ar.c6
-rw-r--r--archival/dpkg_deb.c8
-rw-r--r--archival/gunzip.c16
-rw-r--r--archival/gzip.c12
-rw-r--r--archival/tar.c40
5 files changed, 41 insertions, 41 deletions
diff --git a/archival/ar.c b/archival/ar.c
index 550b2a1c4..5aba30de0 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -65,9 +65,9 @@ extern ar_headers_t get_headers(int srcFd)
/* check ar magic */
if (full_read(srcFd, ar_magic, 8) != 8)
- error_msg_and_die("cannot read magic\n");
+ error_msg_and_die("cannot read magic");
if (strncmp(ar_magic,"!<arch>",7) != 0)
- error_msg_and_die("invalid magic\n");
+ error_msg_and_die("invalid magic");
while (full_read(srcFd, (char *) &raw_ar_header, 60)==60) {
/* check the end of header markers are valid */
@@ -168,7 +168,7 @@ extern int ar_main(int argc, char **argv)
usage(ar_usage);
if ( (srcFd = open(argv[optind], O_RDONLY)) < 0)
- error_msg_and_die("Cannot read %s\n", argv[optind]);
+ error_msg_and_die("Cannot read %s", argv[optind]);
optind++;
head = get_headers(srcFd);
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index 3a789379b..3345c273f 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -118,7 +118,7 @@ extern int dpkg_deb_main(int argc, char **argv)
extract_flag = TRUE;
strcpy(ar_filename, "data.tar.gz");
if ( (optind + 2) > argc ) {
- error_msg_and_die("No directory specified\n");
+ error_msg_and_die("No directory specified");
}
target_dir = (char *) xmalloc(strlen(argv[optind+1]));
strcpy(target_dir, argv[optind+1]);
@@ -128,7 +128,7 @@ extern int dpkg_deb_main(int argc, char **argv)
list_flag = TRUE;
strcpy(ar_filename, "data.tar.gz");
if ( (optind + 2) > argc ) {
- error_msg_and_die("No directory specified\n");
+ error_msg_and_die("No directory specified");
}
target_dir = (char *) xmalloc(strlen(argv[optind+1]));
strcpy(target_dir, argv[optind+1]);
@@ -139,7 +139,7 @@ extern int dpkg_deb_main(int argc, char **argv)
*ar_headers = get_headers(srcFd);
if (ar_headers->next==NULL)
- error_msg_and_die("Couldnt find %s in %s\n",ar_filename, argv[optind]);
+ error_msg_and_die("Couldnt find %s in %s", ar_filename, argv[optind]);
while (ar_headers->next != NULL) {
if (strcmp(ar_headers->name, ar_filename)==0)
@@ -154,7 +154,7 @@ extern int dpkg_deb_main(int argc, char **argv)
mkdir(target_dir, 0755);
}
if (chdir(target_dir)==-1) {
- error_msg_and_die("Cannot change to dir %s\n",argv[optind+1]);
+ error_msg_and_die("Cannot change to dir %s", argv[optind+1]);
}
}
status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list);
diff --git a/archival/gunzip.c b/archival/gunzip.c
index 09571f91c..48a46083b 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -297,7 +297,7 @@ int in; /* input file descriptor */
method = (int) get_byte();
if (method != DEFLATED) {
- error_msg("unknown method %d -- get newer version of gzip\n", method);
+ error_msg("unknown method %d -- get newer version of gzip", method);
exit_code = ERROR;
return -1;
}
@@ -1116,11 +1116,11 @@ int in, out; /* input and output file descriptors */
if (res == 3) {
error_msg(memory_exhausted);
} else if (res != 0) {
- error_msg("invalid compressed data--format violated\n");
+ error_msg("invalid compressed data--format violated");
}
} else {
- error_msg("internal error, invalid method\n");
+ error_msg("internal error, invalid method");
}
/* Get the crc and original length */
@@ -1149,15 +1149,15 @@ int in, out; /* input and output file descriptors */
/* Validate decompression */
if (orig_crc != updcrc(outbuf, 0)) {
- error_msg("invalid compressed data--crc error\n");
+ error_msg("invalid compressed data--crc error");
}
if (orig_len != (ulg) bytes_out) {
- error_msg("invalid compressed data--length error\n");
+ error_msg("invalid compressed data--length error");
}
/* Check if there are more entries in a pkzip file */
if (pkzip && inptr + 4 < insize && LG(inbuf + inptr) == LOCSIG) {
- fprintf(stderr, "has more than one entry--rest ignored\n");
+ error_msg("has more than one entry--rest ignored");
if (exit_code == OK)
exit_code = WARNING;
}
@@ -1261,9 +1261,9 @@ int gunzip_main(int argc, char **argv)
}
if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
- error_msg_and_die( "data not read from terminal. Use -f to force it.\n");
+ error_msg_and_die( "data not read from terminal. Use -f to force it.");
if (isatty(fileno(stdout)) && tostdout==1 && force==0)
- error_msg_and_die( "data not written to terminal. Use -f to force it.\n");
+ error_msg_and_die( "data not written to terminal. Use -f to force it.");
gunzip_init();
diff --git a/archival/gzip.c b/archival/gzip.c
index 5a74868c1..75f3caa35 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -1382,7 +1382,7 @@ int length;
(char *) window + start, length) != EQUAL) {
fprintf(stderr,
" start %d, match %d, length %d\n", start, match, length);
- error_msg("invalid match\n");
+ error_msg("invalid match");
}
if (verbose > 1) {
fprintf(stderr, "\\[%d,%d]", start - match, length);
@@ -1822,9 +1822,9 @@ int gzip_main(int argc, char **argv)
}
if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
- error_msg_and_die( "data not read from terminal. Use -f to force it.\n");
+ error_msg_and_die( "data not read from terminal. Use -f to force it.");
if (isatty(fileno(stdout)) && tostdout==1 && force==0)
- error_msg_and_die( "data not written to terminal. Use -f to force it.\n");
+ error_msg_and_die( "data not written to terminal. Use -f to force it.");
foreground = signal(SIGINT, SIG_IGN) != SIG_IGN;
if (foreground) {
@@ -2894,7 +2894,7 @@ int eof; /* true if this is the last block for a file */
#endif
/* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
if (buf == (char *) 0)
- error_msg("block vanished\n");
+ error_msg("block vanished");
copy_block(buf, (unsigned) stored_len, 0); /* without header */
compressed_len = stored_len << 3;
@@ -3077,7 +3077,7 @@ local void set_file_type()
bin_freq += dyn_ltree[n++].Freq;
*file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII;
if (*file_type == BINARY && translate_eol) {
- error_msg("-l used on binary file\n");
+ error_msg("-l used on binary file");
}
}
@@ -3239,7 +3239,7 @@ char *env; /* name of environment variable */
/* Copy the program name first */
if (oargc-- < 0)
- error_msg("argc<=0\n");
+ error_msg("argc<=0");
*(nargv++) = *(oargv++);
/* Then copy the environment args */
diff --git a/archival/tar.c b/archival/tar.c
index 308291455..60744e8db 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -165,10 +165,10 @@ extern int tar_unzip_init(int tarFd)
signal(SIGCHLD, child_died);
if (pipe(unzip_pipe)!=0)
- error_msg_and_die("pipe error\n");
+ error_msg_and_die("pipe error");
if ( (child_pid = fork()) == -1)
- error_msg_and_die("fork failure\n");
+ error_msg_and_die("fork failure");
if (child_pid==0) {
/* child process */
@@ -259,7 +259,7 @@ extern int tar_main(int argc, char **argv)
break;
case 'f':
if (*tarName != '-')
- error_msg_and_die( "Only one 'f' option allowed\n");
+ error_msg_and_die( "Only one 'f' option allowed");
tarName = optarg;
break;
#if defined BB_FEATURE_TAR_EXCLUDE
@@ -294,11 +294,11 @@ extern int tar_main(int argc, char **argv)
*/
if (createFlag == TRUE) {
#ifndef BB_FEATURE_TAR_CREATE
- error_msg_and_die( "This version of tar was not compiled with tar creation support.\n");
+ error_msg_and_die( "This version of tar was not compiled with tar creation support.");
#else
#ifdef BB_FEATURE_TAR_GZIP
if (unzipFlag==TRUE)
- error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip\n");
+ error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip");
#endif
status = writeTarFile(tarName, verboseFlag, argv + optind, excludeList);
#endif
@@ -330,7 +330,7 @@ extern int tar_main(int argc, char **argv)
return EXIT_FAILURE;
flagError:
- error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified\n");
+ error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified");
}
static void
@@ -383,7 +383,7 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag)
}
if ( (readSize = full_read(header->tarFd, buffer, readSize)) <= 0 ) {
/* Tarball seems to have a problem */
- error_msg("Unexpected EOF in archive\n");
+ error_msg("Unexpected EOF in archive");
return( FALSE);
}
if ( readSize < writeSize )
@@ -476,7 +476,7 @@ tarExtractSymLink(TarInfo *header, int extractFlag, int tostdoutFlag)
/* Do not change permissions or date on symlink,
* since it changes the pointed to file instead. duh. */
#else
- error_msg("%s: Cannot create symlink to '%s': %s\n",
+ error_msg("%s: Cannot create symlink to '%s': %s",
header->name, header->linkname,
"symlinks not supported");
#endif
@@ -543,7 +543,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header)
++*(header->name);
if (alreadyWarned == FALSE) {
- error_msg("Removing leading '/' from member names\n");
+ error_msg("Removing leading '/' from member names");
alreadyWarned = TRUE;
}
}
@@ -644,7 +644,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag,
goto endgame;
} else {
errorFlag=TRUE;
- error_msg("Bad tar header, skipping\n");
+ error_msg("Bad tar header, skipping");
continue;
}
}
@@ -791,7 +791,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag,
break;
#endif
default:
- error_msg("Unknown file type '%c' in tar file\n", header.type);
+ error_msg("Unknown file type '%c' in tar file", header.type);
close( tarFd);
return( FALSE);
}
@@ -803,7 +803,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag,
return ( FALSE);
}
else if (errorFlag==TRUE) {
- error_msg( "Error exit delayed from previous errors\n");
+ error_msg( "Error exit delayed from previous errors");
return( FALSE);
} else
return( status);
@@ -813,7 +813,7 @@ endgame:
close( tarFd);
if ( *(header.name) == '\0' ) {
if (errorFlag==TRUE)
- error_msg( "Error exit delayed from previous errors\n");
+ error_msg( "Error exit delayed from previous errors");
else
return( TRUE);
}
@@ -1002,7 +1002,7 @@ writeTarHeader(struct TarBallInfo *tbInfo, const char *header_name,
header.typeflag = REGTYPE;
putOctal(header.size, sizeof(header.size), statbuf->st_size);
} else {
- error_msg("%s: Unknown file type\n", real_name);
+ error_msg("%s: Unknown file type", real_name);
return ( FALSE);
}
@@ -1061,7 +1061,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
/* It is against the rules to archive a socket */
if (S_ISSOCK(statbuf->st_mode)) {
- error_msg("%s: socket ignored\n", fileName);
+ error_msg("%s: socket ignored", fileName);
return( TRUE);
}
@@ -1070,7 +1070,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
* the new tarball */
if (tbInfo->statBuf.st_dev == statbuf->st_dev &&
tbInfo->statBuf.st_ino == statbuf->st_ino) {
- error_msg("%s: file is the archive; skipping\n", fileName);
+ error_msg("%s: file is the archive; skipping", fileName);
return( TRUE);
}
@@ -1078,7 +1078,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
while (header_name[0] == '/') {
static int alreadyWarned=FALSE;
if (alreadyWarned==FALSE) {
- error_msg("Removing leading '/' from member names\n");
+ error_msg("Removing leading '/' from member names");
alreadyWarned=TRUE;
}
header_name++;
@@ -1111,7 +1111,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void*
/* open the file we want to archive, and make sure all is well */
if ((inputFileFd = open(fileName, O_RDONLY)) < 0) {
- error_msg("%s: Cannot open: %s\n", fileName, strerror(errno));
+ error_msg("%s: Cannot open: %s", fileName, strerror(errno));
return( FALSE);
}
@@ -1150,7 +1150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
/* Make sure there is at least one file to tar up. */
if (*argv == NULL)
- error_msg_and_die("Cowardly refusing to create an empty archive\n");
+ error_msg_and_die("Cowardly refusing to create an empty archive");
/* Open the tar file for writing. */
if (!strcmp(tarName, "-"))
@@ -1193,7 +1193,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv,
/* Hang up the tools, close up shop, head home */
close(tarFd);
if (errorFlag == TRUE) {
- error_msg("Error exit delayed from previous errors\n");
+ error_msg("Error exit delayed from previous errors");
freeHardLinkInfo(&tbInfo.hlInfoHead);
return(FALSE);
}