last nail into error_msg() (de)capitalization
This commit is contained in:
parent
1340ca8c87
commit
d3d004dd35
@ -222,7 +222,7 @@ int unzip_main(int argc, char **argv)
|
|||||||
if (magic == ZIP_CDS_MAGIC) {
|
if (magic == ZIP_CDS_MAGIC) {
|
||||||
break;
|
break;
|
||||||
} else if (magic != ZIP_FILEHEADER_MAGIC) {
|
} else if (magic != ZIP_FILEHEADER_MAGIC) {
|
||||||
bb_error_msg_and_die("Invalid zip magic %08X", magic);
|
bb_error_msg_and_die("invalid zip magic %08X", magic);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the file header */
|
/* Read the file header */
|
||||||
@ -238,7 +238,7 @@ int unzip_main(int argc, char **argv)
|
|||||||
zip_header.formatted.filename_len = SWAP_LE32(zip_header.formatted.filename_len);
|
zip_header.formatted.filename_len = SWAP_LE32(zip_header.formatted.filename_len);
|
||||||
zip_header.formatted.extra_len = SWAP_LE32(zip_header.formatted.extra_len);
|
zip_header.formatted.extra_len = SWAP_LE32(zip_header.formatted.extra_len);
|
||||||
if ((zip_header.formatted.method != 0) && (zip_header.formatted.method != 8)) {
|
if ((zip_header.formatted.method != 0) && (zip_header.formatted.method != 8)) {
|
||||||
bb_error_msg_and_die("Unsupported compression method %d", zip_header.formatted.method);
|
bb_error_msg_and_die("unsupported compression method %d", zip_header.formatted.method);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read filename */
|
/* Read filename */
|
||||||
@ -251,7 +251,7 @@ int unzip_main(int argc, char **argv)
|
|||||||
|
|
||||||
if ((verbosity == v_list) && !list_header_done){
|
if ((verbosity == v_list) && !list_header_done){
|
||||||
printf(" Length Date Time Name\n"
|
printf(" Length Date Time Name\n"
|
||||||
" -------- ---- ---- ----\n");
|
" -------- ---- ---- ----\n");
|
||||||
list_header_done = 1;
|
list_header_done = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,14 +282,14 @@ int unzip_main(int argc, char **argv)
|
|||||||
} else if (last_char_is(dst_fn, '/')) { /* Extract directory */
|
} else if (last_char_is(dst_fn, '/')) { /* Extract directory */
|
||||||
if (stat(dst_fn, &stat_buf) == -1) {
|
if (stat(dst_fn, &stat_buf) == -1) {
|
||||||
if (errno != ENOENT) {
|
if (errno != ENOENT) {
|
||||||
bb_perror_msg_and_die("Cannot stat '%s'",dst_fn);
|
bb_perror_msg_and_die("cannot stat '%s'",dst_fn);
|
||||||
}
|
}
|
||||||
if (verbosity == v_normal) {
|
if (verbosity == v_normal) {
|
||||||
printf(" creating: %s\n", dst_fn);
|
printf(" creating: %s\n", dst_fn);
|
||||||
}
|
}
|
||||||
unzip_create_leading_dirs(dst_fn);
|
unzip_create_leading_dirs(dst_fn);
|
||||||
if (bb_make_directory(dst_fn, 0777, 0)) {
|
if (bb_make_directory(dst_fn, 0777, 0)) {
|
||||||
bb_error_msg_and_die("Exiting");
|
bb_error_msg_and_die("exiting");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!S_ISDIR(stat_buf.st_mode)) {
|
if (!S_ISDIR(stat_buf.st_mode)) {
|
||||||
@ -302,7 +302,7 @@ int unzip_main(int argc, char **argv)
|
|||||||
_check_file:
|
_check_file:
|
||||||
if (stat(dst_fn, &stat_buf) == -1) { /* File does not exist */
|
if (stat(dst_fn, &stat_buf) == -1) { /* File does not exist */
|
||||||
if (errno != ENOENT) {
|
if (errno != ENOENT) {
|
||||||
bb_perror_msg_and_die("Cannot stat '%s'",dst_fn);
|
bb_perror_msg_and_die("cannot stat '%s'",dst_fn);
|
||||||
}
|
}
|
||||||
i = 'y';
|
i = 'y';
|
||||||
|
|
||||||
@ -316,7 +316,7 @@ int unzip_main(int argc, char **argv)
|
|||||||
} else {
|
} else {
|
||||||
printf("replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", dst_fn);
|
printf("replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", dst_fn);
|
||||||
if (!fgets(key_buf, 512, stdin)) {
|
if (!fgets(key_buf, 512, stdin)) {
|
||||||
bb_perror_msg_and_die("Cannot read input");
|
bb_perror_msg_and_die("cannot read input");
|
||||||
}
|
}
|
||||||
i = key_buf[0];
|
i = key_buf[0];
|
||||||
}
|
}
|
||||||
@ -358,7 +358,7 @@ int unzip_main(int argc, char **argv)
|
|||||||
/* Prompt for new name */
|
/* Prompt for new name */
|
||||||
printf("new name: ");
|
printf("new name: ");
|
||||||
if (!fgets(key_buf, 512, stdin)) {
|
if (!fgets(key_buf, 512, stdin)) {
|
||||||
bb_perror_msg_and_die("Cannot read input");
|
bb_perror_msg_and_die("cannot read input");
|
||||||
}
|
}
|
||||||
free(dst_fn);
|
free(dst_fn);
|
||||||
dst_fn = xstrdup(key_buf);
|
dst_fn = xstrdup(key_buf);
|
||||||
|
@ -51,7 +51,7 @@ static void do_loadfont(int fd, unsigned char *inbuf, int unit, int fontsize)
|
|||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
|
|
||||||
if (unit < 1 || unit > 32)
|
if (unit < 1 || unit > 32)
|
||||||
bb_error_msg_and_die("Bad character size %d", unit);
|
bb_error_msg_and_die("bad character size %d", unit);
|
||||||
|
|
||||||
for (i = 0; i < fontsize; i++)
|
for (i = 0; i < fontsize; i++)
|
||||||
memcpy(buf + (32 * i), inbuf + (unit * i), unit);
|
memcpy(buf + (32 * i), inbuf + (unit * i), unit);
|
||||||
@ -108,8 +108,8 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
|
|||||||
if (ioctl(fd, PIO_UNIMAPCLR, &advice)) {
|
if (ioctl(fd, PIO_UNIMAPCLR, &advice)) {
|
||||||
#ifdef ENOIOCTLCMD
|
#ifdef ENOIOCTLCMD
|
||||||
if (errno == ENOIOCTLCMD) {
|
if (errno == ENOIOCTLCMD) {
|
||||||
bb_error_msg("It seems this kernel is older than 1.1.92");
|
bb_error_msg("it seems this kernel is older than 1.1.92");
|
||||||
bb_error_msg_and_die("No Unicode mapping table loaded.");
|
bb_error_msg_and_die("no Unicode mapping table loaded");
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
bb_perror_msg_and_die("PIO_UNIMAPCLR");
|
bb_perror_msg_and_die("PIO_UNIMAPCLR");
|
||||||
@ -134,13 +134,13 @@ static void loadnewfont(int fd)
|
|||||||
*/
|
*/
|
||||||
inputlth = fread(inbuf, 1, sizeof(inbuf), stdin);
|
inputlth = fread(inbuf, 1, sizeof(inbuf), stdin);
|
||||||
if (ferror(stdin))
|
if (ferror(stdin))
|
||||||
bb_perror_msg_and_die("Error reading input font");
|
bb_perror_msg_and_die("error reading input font");
|
||||||
/* use malloc/realloc in case of giant files;
|
/* use malloc/realloc in case of giant files;
|
||||||
maybe these do not occur: 16kB for the font,
|
maybe these do not occur: 16kB for the font,
|
||||||
and 16kB for the map leaves 32 unicode values
|
and 16kB for the map leaves 32 unicode values
|
||||||
for each font position */
|
for each font position */
|
||||||
if (!feof(stdin))
|
if (!feof(stdin))
|
||||||
bb_perror_msg_and_die("Font too large");
|
bb_perror_msg_and_die("font too large");
|
||||||
|
|
||||||
/* test for psf first */
|
/* test for psf first */
|
||||||
{
|
{
|
||||||
@ -158,11 +158,11 @@ static void loadnewfont(int fd)
|
|||||||
goto no_psf;
|
goto no_psf;
|
||||||
|
|
||||||
if (psfhdr.mode > PSF_MAXMODE)
|
if (psfhdr.mode > PSF_MAXMODE)
|
||||||
bb_error_msg_and_die("Unsupported psf file mode");
|
bb_error_msg_and_die("unsupported psf file mode");
|
||||||
fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
|
fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
|
||||||
#if !defined( PIO_FONTX ) || defined( __sparc__ )
|
#if !defined( PIO_FONTX ) || defined( __sparc__ )
|
||||||
if (fontsize != 256)
|
if (fontsize != 256)
|
||||||
bb_error_msg_and_die("Only fontsize 256 supported");
|
bb_error_msg_and_die("only fontsize 256 supported");
|
||||||
#endif
|
#endif
|
||||||
hastable = (psfhdr.mode & PSF_MODEHASTAB);
|
hastable = (psfhdr.mode & PSF_MODEHASTAB);
|
||||||
unit = psfhdr.charsize;
|
unit = psfhdr.charsize;
|
||||||
@ -170,7 +170,7 @@ static void loadnewfont(int fd)
|
|||||||
|
|
||||||
head = head0 + fontsize * unit;
|
head = head0 + fontsize * unit;
|
||||||
if (head > inputlth || (!hastable && head != inputlth))
|
if (head > inputlth || (!hastable && head != inputlth))
|
||||||
bb_error_msg_and_die("Input file: bad length");
|
bb_error_msg_and_die("input file: bad length");
|
||||||
do_loadfont(fd, inbuf + head0, unit, fontsize);
|
do_loadfont(fd, inbuf + head0, unit, fontsize);
|
||||||
if (hastable)
|
if (hastable)
|
||||||
do_loadtable(fd, inbuf + head, inputlth - head, fontsize);
|
do_loadtable(fd, inbuf + head, inputlth - head, fontsize);
|
||||||
@ -185,7 +185,7 @@ static void loadnewfont(int fd)
|
|||||||
} else {
|
} else {
|
||||||
/* bare font */
|
/* bare font */
|
||||||
if (inputlth & 0377)
|
if (inputlth & 0377)
|
||||||
bb_error_msg_and_die("Bad input file size");
|
bb_error_msg_and_die("bad input file size");
|
||||||
offset = 0;
|
offset = 0;
|
||||||
unit = inputlth / 256;
|
unit = inputlth / 256;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ static int compare_keys(const void *xarg, const void *yarg)
|
|||||||
/* Perform actual comparison */
|
/* Perform actual comparison */
|
||||||
switch(flags&7) {
|
switch(flags&7) {
|
||||||
default:
|
default:
|
||||||
bb_error_msg_and_die("Unknown sort type.");
|
bb_error_msg_and_die("unknown sort type");
|
||||||
break;
|
break;
|
||||||
/* Ascii sort */
|
/* Ascii sort */
|
||||||
case 0:
|
case 0:
|
||||||
@ -233,12 +233,12 @@ int sort_main(int argc, char **argv)
|
|||||||
switch(*line) {
|
switch(*line) {
|
||||||
#ifdef CONFIG_FEATURE_SORT_BIG
|
#ifdef CONFIG_FEATURE_SORT_BIG
|
||||||
case 'o':
|
case 'o':
|
||||||
if(outfile) bb_error_msg_and_die("Too many -o.");
|
if(outfile) bb_error_msg_and_die("too many -o");
|
||||||
outfile=xfopen(optarg,"w");
|
outfile=xfopen(optarg,"w");
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
if(key_separator || optarg[1])
|
if(key_separator || optarg[1])
|
||||||
bb_error_msg_and_die("Too many -t.");
|
bb_error_msg_and_die("too many -t");
|
||||||
key_separator=*optarg;
|
key_separator=*optarg;
|
||||||
break;
|
break;
|
||||||
/* parse sort key */
|
/* parse sort key */
|
||||||
@ -262,7 +262,7 @@ int sort_main(int argc, char **argv)
|
|||||||
temp2=strchr(optlist,*temp);
|
temp2=strchr(optlist,*temp);
|
||||||
flag=(1<<(temp2-optlist));
|
flag=(1<<(temp2-optlist));
|
||||||
if(!temp2 || (flag>FLAG_M && flag<FLAG_b))
|
if(!temp2 || (flag>FLAG_M && flag<FLAG_b))
|
||||||
bb_error_msg_and_die("Unknown key option.");
|
bb_error_msg_and_die("unknown key option");
|
||||||
/* b after , means strip _trailing_ space */
|
/* b after , means strip _trailing_ space */
|
||||||
if(i && flag==FLAG_b) flag=FLAG_bb;
|
if(i && flag==FLAG_b) flag=FLAG_bb;
|
||||||
key->flags|=flag;
|
key->flags|=flag;
|
||||||
|
@ -23,7 +23,7 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream)
|
|||||||
char *line_ptr = line;
|
char *line_ptr = line;
|
||||||
|
|
||||||
if (strcmp(line, "end") == 0) {
|
if (strcmp(line, "end") == 0) {
|
||||||
return(EXIT_SUCCESS);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
length = ((*line_ptr - 0x20) & 0x3f)* 4 / 3;
|
length = ((*line_ptr - 0x20) & 0x3f)* 4 / 3;
|
||||||
|
|
||||||
@ -32,13 +32,13 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (length > 60) {
|
if (length > 60) {
|
||||||
bb_error_msg_and_die("Line too long");
|
bb_error_msg_and_die("line too long");
|
||||||
}
|
}
|
||||||
|
|
||||||
line_ptr++;
|
line_ptr++;
|
||||||
/* Tolerate an overly long line to accomodate a possible exta '`' */
|
/* Tolerate an overly long line to accomodate a possible exta '`' */
|
||||||
if (strlen(line_ptr) < (size_t)length) {
|
if (strlen(line_ptr) < (size_t)length) {
|
||||||
bb_error_msg_and_die("Short file");
|
bb_error_msg_and_die("short file");
|
||||||
}
|
}
|
||||||
|
|
||||||
while (length > 0) {
|
while (length > 0) {
|
||||||
@ -63,7 +63,7 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream)
|
|||||||
}
|
}
|
||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
bb_error_msg_and_die("Short file");
|
bb_error_msg_and_die("short file");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int read_base64(FILE *src_stream, FILE *dst_stream)
|
static int read_base64(FILE *src_stream, FILE *dst_stream)
|
||||||
@ -84,7 +84,7 @@ static int read_base64(FILE *src_stream, FILE *dst_stream)
|
|||||||
do {
|
do {
|
||||||
ch = fgetc(src_stream);
|
ch = fgetc(src_stream);
|
||||||
if (ch == EOF) {
|
if (ch == EOF) {
|
||||||
bb_error_msg_and_die("Short file");
|
bb_error_msg_and_die("short file");
|
||||||
}
|
}
|
||||||
} while ((table_ptr = strchr(base64_table, ch)) == NULL);
|
} while ((table_ptr = strchr(base64_table, ch)) == NULL);
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ static int read_base64(FILE *src_stream, FILE *dst_stream)
|
|||||||
else if (*table_ptr == '\n') {
|
else if (*table_ptr == '\n') {
|
||||||
/* Check for terminating line */
|
/* Check for terminating line */
|
||||||
if (term_count == 5) {
|
if (term_count == 5) {
|
||||||
return(EXIT_SUCCESS);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
term_count = 1;
|
term_count = 1;
|
||||||
continue;
|
continue;
|
||||||
@ -175,7 +175,7 @@ int uudecode_main(int argc, char **argv)
|
|||||||
free(line);
|
free(line);
|
||||||
ret = decode_fn_ptr(src_stream, dst_stream);
|
ret = decode_fn_ptr(src_stream, dst_stream);
|
||||||
fclose_if_not_stdin(src_stream);
|
fclose_if_not_stdin(src_stream);
|
||||||
return(ret);
|
return ret;
|
||||||
}
|
}
|
||||||
bb_error_msg_and_die("No `begin' line");
|
bb_error_msg_and_die("no 'begin' line");
|
||||||
}
|
}
|
||||||
|
66
editors/ed.c
66
editors/ed.c
@ -57,7 +57,7 @@ int ed_main(int argc, char **argv)
|
|||||||
fileName = strdup(argv[1]);
|
fileName = strdup(argv[1]);
|
||||||
|
|
||||||
if (fileName == NULL) {
|
if (fileName == NULL) {
|
||||||
bb_error_msg("No memory");
|
bb_error_msg("no memory");
|
||||||
termEdit();
|
termEdit();
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ static void doCommands(void)
|
|||||||
|
|
||||||
if (*endbuf != '\n')
|
if (*endbuf != '\n')
|
||||||
{
|
{
|
||||||
bb_error_msg("Command line too long");
|
bb_error_msg("command line too long");
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -182,7 +182,7 @@ static void doCommands(void)
|
|||||||
case 'f':
|
case 'f':
|
||||||
if (*cp && !isblank(*cp))
|
if (*cp && !isblank(*cp))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad file command");
|
bb_error_msg("bad file command");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ static void doCommands(void)
|
|||||||
|
|
||||||
if (newname == NULL)
|
if (newname == NULL)
|
||||||
{
|
{
|
||||||
bb_error_msg("No memory for file name");
|
bb_error_msg("no memory for file name");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ static void doCommands(void)
|
|||||||
|
|
||||||
if ((*cp < 'a') || (*cp > 'a') || cp[1])
|
if ((*cp < 'a') || (*cp > 'a') || cp[1])
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad mark name");
|
bb_error_msg("bad mark name");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ static void doCommands(void)
|
|||||||
|
|
||||||
if (have1 || *cp)
|
if (have1 || *cp)
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad quit command");
|
bb_error_msg("bad quit command");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +269,7 @@ static void doCommands(void)
|
|||||||
case 'r':
|
case 'r':
|
||||||
if (*cp && !isblank(*cp))
|
if (*cp && !isblank(*cp))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad read command");
|
bb_error_msg("bad read command");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ static void doCommands(void)
|
|||||||
|
|
||||||
if (*cp == '\0')
|
if (*cp == '\0')
|
||||||
{
|
{
|
||||||
bb_error_msg("No file name");
|
bb_error_msg("no file name");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ static void doCommands(void)
|
|||||||
case 'w':
|
case 'w':
|
||||||
if (*cp && !isblank(*cp))
|
if (*cp && !isblank(*cp))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad write command");
|
bb_error_msg("bad write command");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ static void doCommands(void)
|
|||||||
|
|
||||||
if (cp == NULL)
|
if (cp == NULL)
|
||||||
{
|
{
|
||||||
bb_error_msg("No file name specified");
|
bb_error_msg("no file name specified");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,7 +342,7 @@ static void doCommands(void)
|
|||||||
case '.':
|
case '.':
|
||||||
if (have1)
|
if (have1)
|
||||||
{
|
{
|
||||||
bb_error_msg("No arguments allowed");
|
bb_error_msg("no arguments allowed");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ static void doCommands(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
bb_error_msg("Unimplemented command");
|
bb_error_msg("unimplemented command");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -392,7 +392,7 @@ static void subCommand(const char * cmd, int num1, int num2)
|
|||||||
|
|
||||||
if ((num1 < 1) || (num2 > lastNum) || (num1 > num2))
|
if ((num1 < 1) || (num2 > lastNum) || (num1 > num2))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad line range for substitute");
|
bb_error_msg("bad line range for substitute");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -410,7 +410,7 @@ static void subCommand(const char * cmd, int num1, int num2)
|
|||||||
|
|
||||||
if (isblank(*cp) || (*cp == '\0'))
|
if (isblank(*cp) || (*cp == '\0'))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad delimiter for substitute");
|
bb_error_msg("bad delimiter for substitute");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -422,7 +422,7 @@ static void subCommand(const char * cmd, int num1, int num2)
|
|||||||
|
|
||||||
if (cp == NULL)
|
if (cp == NULL)
|
||||||
{
|
{
|
||||||
bb_error_msg("Missing 2nd delimiter for substitute");
|
bb_error_msg("missing 2nd delimiter for substitute");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -448,7 +448,7 @@ static void subCommand(const char * cmd, int num1, int num2)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
bb_error_msg("Unknown option for substitute");
|
bb_error_msg("unknown option for substitute");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -457,7 +457,7 @@ static void subCommand(const char * cmd, int num1, int num2)
|
|||||||
{
|
{
|
||||||
if (searchString[0] == '\0')
|
if (searchString[0] == '\0')
|
||||||
{
|
{
|
||||||
bb_error_msg("No previous search string");
|
bb_error_msg("no previous search string");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -545,7 +545,7 @@ static void subCommand(const char * cmd, int num1, int num2)
|
|||||||
|
|
||||||
if (nlp == NULL)
|
if (nlp == NULL)
|
||||||
{
|
{
|
||||||
bb_error_msg("Cannot get memory for line");
|
bb_error_msg("cannot get memory for line");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -587,7 +587,7 @@ static void subCommand(const char * cmd, int num1, int num2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!didSub)
|
if (!didSub)
|
||||||
bb_error_msg("No substitutions found for \"%s\"", oldStr);
|
bb_error_msg("no substitutions found for \"%s\"", oldStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -651,7 +651,7 @@ static void addLines(int num)
|
|||||||
|
|
||||||
if (buf[len - 1] != '\n')
|
if (buf[len - 1] != '\n')
|
||||||
{
|
{
|
||||||
bb_error_msg("Line too long");
|
bb_error_msg("line too long");
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -711,7 +711,7 @@ static int getNum(const char **retcp, int *retHaveNum, int *retNum)
|
|||||||
|
|
||||||
if ((*cp < 'a') || (*cp > 'z'))
|
if ((*cp < 'a') || (*cp > 'z'))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad mark name");
|
bb_error_msg("bad mark name");
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -799,7 +799,7 @@ static int initEdit(void)
|
|||||||
|
|
||||||
if (bufBase == NULL)
|
if (bufBase == NULL)
|
||||||
{
|
{
|
||||||
bb_error_msg("No memory for buffer");
|
bb_error_msg("no memory for buffer");
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -865,7 +865,7 @@ static int readLines(const char * file, int num)
|
|||||||
|
|
||||||
if ((num < 1) || (num > lastNum + 1))
|
if ((num < 1) || (num > lastNum + 1))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad line for read");
|
bb_error_msg("bad line for read");
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -925,7 +925,7 @@ static int readLines(const char * file, int num)
|
|||||||
|
|
||||||
if (cp == NULL)
|
if (cp == NULL)
|
||||||
{
|
{
|
||||||
bb_error_msg("No memory for buffer");
|
bb_error_msg("no memory for buffer");
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -984,7 +984,7 @@ static int writeLines(const char * file, int num1, int num2)
|
|||||||
|
|
||||||
if ((num1 < 1) || (num2 > lastNum) || (num1 > num2))
|
if ((num1 < 1) || (num2 > lastNum) || (num1 > num2))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad line range for write");
|
bb_error_msg("bad line range for write");
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1054,7 +1054,7 @@ static int printLines(int num1, int num2, int expandFlag)
|
|||||||
|
|
||||||
if ((num1 < 1) || (num2 > lastNum) || (num1 > num2))
|
if ((num1 < 1) || (num2 > lastNum) || (num1 > num2))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad line range for print");
|
bb_error_msg("bad line range for print");
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1133,7 +1133,7 @@ static int insertLine(int num, const char * data, int len)
|
|||||||
|
|
||||||
if ((num < 1) || (num > lastNum + 1))
|
if ((num < 1) || (num > lastNum + 1))
|
||||||
{
|
{
|
||||||
bb_error_msg("Inserting at bad line number");
|
bb_error_msg("inserting at bad line number");
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1142,7 +1142,7 @@ static int insertLine(int num, const char * data, int len)
|
|||||||
|
|
||||||
if (newLp == NULL)
|
if (newLp == NULL)
|
||||||
{
|
{
|
||||||
bb_error_msg("Failed to allocate memory for line");
|
bb_error_msg("failed to allocate memory for line");
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1186,7 +1186,7 @@ static int deleteLines(int num1, int num2)
|
|||||||
|
|
||||||
if ((num1 < 1) || (num2 > lastNum) || (num1 > num2))
|
if ((num1 < 1) || (num2 > lastNum) || (num1 > num2))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad line numbers for delete");
|
bb_error_msg("bad line numbers for delete");
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1246,7 +1246,7 @@ static int searchLines(const char *str, int num1, int num2)
|
|||||||
|
|
||||||
if ((num1 < 1) || (num2 > lastNum) || (num1 > num2))
|
if ((num1 < 1) || (num2 > lastNum) || (num1 > num2))
|
||||||
{
|
{
|
||||||
bb_error_msg("Bad line numbers for search");
|
bb_error_msg("bad line numbers for search");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1255,7 +1255,7 @@ static int searchLines(const char *str, int num1, int num2)
|
|||||||
{
|
{
|
||||||
if (searchString[0] == '\0')
|
if (searchString[0] == '\0')
|
||||||
{
|
{
|
||||||
bb_error_msg("No previous search string");
|
bb_error_msg("no previous search string");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1282,7 +1282,7 @@ static int searchLines(const char *str, int num1, int num2)
|
|||||||
lp = lp->next;
|
lp = lp->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
bb_error_msg("Cannot find string \"%s\"", str);
|
bb_error_msg("cannot find string \"%s\"", str);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1298,7 +1298,7 @@ static LINE *findLine(int num)
|
|||||||
|
|
||||||
if ((num < 1) || (num > lastNum))
|
if ((num < 1) || (num > lastNum))
|
||||||
{
|
{
|
||||||
bb_error_msg("Line number %d does not exist", num);
|
bb_error_msg("line number %d does not exist", num);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -610,7 +610,7 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line)
|
|||||||
if (sed_cmd->sub_match == NULL) {
|
if (sed_cmd->sub_match == NULL) {
|
||||||
current_regex = bbg.previous_regex_ptr;
|
current_regex = bbg.previous_regex_ptr;
|
||||||
if (!current_regex)
|
if (!current_regex)
|
||||||
bb_error_msg_and_die("No previous regexp.");
|
bb_error_msg_and_die("no previous regexp");
|
||||||
} else
|
} else
|
||||||
bbg.previous_regex_ptr = current_regex = sed_cmd->sub_match;
|
bbg.previous_regex_ptr = current_regex = sed_cmd->sub_match;
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ static void rewrite(FS * fs)
|
|||||||
}
|
}
|
||||||
/* Unlike the original, output the remainder of the format string. */
|
/* Unlike the original, output the remainder of the format string. */
|
||||||
if (!*byte_count_str) {
|
if (!*byte_count_str) {
|
||||||
bb_error_msg_and_die("bad byte count for conversion character %s.", p1);
|
bb_error_msg_and_die("bad byte count for conversion character %s", p1);
|
||||||
}
|
}
|
||||||
pr->bcnt = *byte_count_str;
|
pr->bcnt = *byte_count_str;
|
||||||
} else if (*p1 == 'l') {
|
} else if (*p1 == 'l') {
|
||||||
@ -186,7 +186,7 @@ static void rewrite(FS * fs)
|
|||||||
} else if (sokay == USEPREC) {
|
} else if (sokay == USEPREC) {
|
||||||
pr->bcnt = prec;
|
pr->bcnt = prec;
|
||||||
} else { /* NOTOKAY */
|
} else { /* NOTOKAY */
|
||||||
bb_error_msg_and_die("%%s requires a precision or a byte count.");
|
bb_error_msg_and_die("%%s requires a precision or a byte count");
|
||||||
}
|
}
|
||||||
} else if (*p1 == '_') {
|
} else if (*p1 == '_') {
|
||||||
++p2;
|
++p2;
|
||||||
@ -220,7 +220,7 @@ static void rewrite(FS * fs)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DO_BAD_CONV_CHAR:
|
DO_BAD_CONV_CHAR:
|
||||||
bb_error_msg_and_die("bad conversion character %%%s.", p1);
|
bb_error_msg_and_die("bad conversion character %%%s", p1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -253,7 +253,7 @@ static void rewrite(FS * fs)
|
|||||||
|
|
||||||
/* only one conversion character if byte count */
|
/* only one conversion character if byte count */
|
||||||
if (!(pr->flags & F_ADDRESS) && fu->bcnt && nconv++) {
|
if (!(pr->flags & F_ADDRESS) && fu->bcnt && nconv++) {
|
||||||
bb_error_msg_and_die("byte count with multiple conversion characters.");
|
bb_error_msg_and_die("byte count with multiple conversion characters");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -78,7 +78,7 @@ int mt_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (code->name == 0) {
|
if (code->name == 0) {
|
||||||
bb_error_msg("unrecognized opcode %s.", argv[1]);
|
bb_error_msg("unrecognized opcode %s", argv[1]);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -725,7 +725,7 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t *
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !dt ) {
|
if( !dt ) {
|
||||||
bb_error_msg ("module %s not found.", mod);
|
bb_error_msg ("module %s not found", mod);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -749,7 +749,7 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t *
|
|||||||
dt = adt;
|
dt = adt;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bb_error_msg ("module %s not found.", mod);
|
bb_error_msg ("module %s not found", mod);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
|
|||||||
|
|
||||||
rth->fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
rth->fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||||
if (rth->fd < 0) {
|
if (rth->fd < 0) {
|
||||||
bb_perror_msg("Cannot open netlink socket");
|
bb_perror_msg("cannot open netlink socket");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,20 +45,20 @@ int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
|
|||||||
rth->local.nl_groups = subscriptions;
|
rth->local.nl_groups = subscriptions;
|
||||||
|
|
||||||
if (bind(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local)) < 0) {
|
if (bind(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local)) < 0) {
|
||||||
bb_perror_msg("Cannot bind netlink socket");
|
bb_perror_msg("cannot bind netlink socket");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
addr_len = sizeof(rth->local);
|
addr_len = sizeof(rth->local);
|
||||||
if (getsockname(rth->fd, (struct sockaddr*)&rth->local, &addr_len) < 0) {
|
if (getsockname(rth->fd, (struct sockaddr*)&rth->local, &addr_len) < 0) {
|
||||||
bb_perror_msg("Cannot getsockname");
|
bb_perror_msg("cannot getsockname");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (addr_len != sizeof(rth->local)) {
|
if (addr_len != sizeof(rth->local)) {
|
||||||
bb_error_msg("Wrong address length %d", addr_len);
|
bb_error_msg("wrong address length %d", addr_len);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (rth->local.nl_family != AF_NETLINK) {
|
if (rth->local.nl_family != AF_NETLINK) {
|
||||||
bb_error_msg("Wrong address family %d", rth->local.nl_family);
|
bb_error_msg("wrong address family %d", rth->local.nl_family);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
rth->seq = time(NULL);
|
rth->seq = time(NULL);
|
||||||
@ -195,11 +195,11 @@ skip_it:
|
|||||||
h = NLMSG_NEXT(h, status);
|
h = NLMSG_NEXT(h, status);
|
||||||
}
|
}
|
||||||
if (msg.msg_flags & MSG_TRUNC) {
|
if (msg.msg_flags & MSG_TRUNC) {
|
||||||
bb_error_msg("Message truncated");
|
bb_error_msg("message truncated");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (status) {
|
if (status) {
|
||||||
bb_error_msg_and_die("!!!Remnant of size %d", status);
|
bb_error_msg_and_die("remnant of size %d!", status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
|
|||||||
status = sendmsg(rtnl->fd, &msg, 0);
|
status = sendmsg(rtnl->fd, &msg, 0);
|
||||||
|
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
bb_perror_msg("Cannot talk to rtnetlink");
|
bb_perror_msg("cannot talk to rtnetlink");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,10 +265,10 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
|
|||||||
|
|
||||||
if (l<0 || len>status) {
|
if (l<0 || len>status) {
|
||||||
if (msg.msg_flags & MSG_TRUNC) {
|
if (msg.msg_flags & MSG_TRUNC) {
|
||||||
bb_error_msg("Truncated message");
|
bb_error_msg("truncated message");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
bb_error_msg_and_die("!!!malformed message: len=%d", len);
|
bb_error_msg_and_die("malformed message: len=%d!", len);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nladdr.nl_pid != peer ||
|
if (nladdr.nl_pid != peer ||
|
||||||
@ -304,17 +304,17 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bb_error_msg("Unexpected reply!!!");
|
bb_error_msg("unexpected reply!");
|
||||||
|
|
||||||
status -= NLMSG_ALIGN(len);
|
status -= NLMSG_ALIGN(len);
|
||||||
h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
|
h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
|
||||||
}
|
}
|
||||||
if (msg.msg_flags & MSG_TRUNC) {
|
if (msg.msg_flags & MSG_TRUNC) {
|
||||||
bb_error_msg("Message truncated");
|
bb_error_msg("message truncated");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (status) {
|
if (status) {
|
||||||
bb_error_msg_and_die("!!!Remnant of size %d", status);
|
bb_error_msg_and_die("remnant of size %d!", status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -390,7 +390,7 @@ int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len)
|
|||||||
rta = RTA_NEXT(rta,len);
|
rta = RTA_NEXT(rta,len);
|
||||||
}
|
}
|
||||||
if (len) {
|
if (len) {
|
||||||
bb_error_msg("!!!Deficit %d, rta_len=%d", len, rta->rta_len);
|
bb_error_msg("deficit %d, rta_len=%d!", len, rta->rta_len);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ int ll_addr_a2n(unsigned char *lladdr, int len, char *arg)
|
|||||||
if (strchr(arg, '.')) {
|
if (strchr(arg, '.')) {
|
||||||
inet_prefix pfx;
|
inet_prefix pfx;
|
||||||
if (get_addr_1(&pfx, arg, AF_INET)) {
|
if (get_addr_1(&pfx, arg, AF_INET)) {
|
||||||
bb_error_msg("\"%s\" is invalid lladdr.", arg);
|
bb_error_msg("\"%s\" is invalid lladdr", arg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (len < 4) {
|
if (len < 4) {
|
||||||
@ -67,11 +67,11 @@ int ll_addr_a2n(unsigned char *lladdr, int len, char *arg)
|
|||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
if (sscanf(arg, "%x", &temp) != 1) {
|
if (sscanf(arg, "%x", &temp) != 1) {
|
||||||
bb_error_msg("\"%s\" is invalid lladdr.", arg);
|
bb_error_msg("\"%s\" is invalid lladdr", arg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (temp < 0 || temp > 255) {
|
if (temp < 0 || temp > 255) {
|
||||||
bb_error_msg("\"%s\" is invalid lladdr.", arg);
|
bb_error_msg("\"%s\" is invalid lladdr", arg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
lladdr[i] = temp;
|
lladdr[i] = temp;
|
||||||
|
@ -287,7 +287,7 @@ read_line(void)
|
|||||||
line_ptr = line_buffer;
|
line_ptr = line_buffer;
|
||||||
if (!fgets(line_buffer, LINE_LENGTH, stdin)) {
|
if (!fgets(line_buffer, LINE_LENGTH, stdin)) {
|
||||||
/* error or eof */
|
/* error or eof */
|
||||||
bb_error_msg_and_die("\ngot EOF - exiting...");
|
bb_error_msg_and_die("\ngot EOF, exiting");
|
||||||
}
|
}
|
||||||
while (*line_ptr && !isgraph(*line_ptr))
|
while (*line_ptr && !isgraph(*line_ptr))
|
||||||
line_ptr++;
|
line_ptr++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user