A couple things that got tangled up in my tree, easier to check in both than
untangle them: Rewrite u_signal_names() into get_signum() and get_signame(), plus trim the signal list to that required by posix (they can specify the numbers for the rest if they really need them). (This is preparatory cleanup for adding a timeout applet like Roberto Foglietta wants.) Export the itoa (added due to Denis Vlasenko, although it's not quite his preferred implementation) from xfuncs.c so it's actually used, and remove several other redundant implementations of itoa and utoa() in the tree.
This commit is contained in:
31
shell/lash.c
31
shell/lash.c
@@ -22,18 +22,7 @@
|
||||
|
||||
|
||||
#include "busybox.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
#include <termios.h>
|
||||
#include "cmdedit.h"
|
||||
|
||||
#ifdef CONFIG_LOCALE_SUPPORT
|
||||
@@ -697,26 +686,6 @@ static int get_command(FILE * source, char *command)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* itoa(int i)
|
||||
{
|
||||
static char a[7]; /* Max 7 ints */
|
||||
char *b = a + sizeof(a) - 1;
|
||||
int sign = (i < 0);
|
||||
|
||||
if (sign)
|
||||
i = -i;
|
||||
*b = 0;
|
||||
do
|
||||
{
|
||||
*--b = '0' + (i % 10);
|
||||
i /= 10;
|
||||
}
|
||||
while (i);
|
||||
if (sign)
|
||||
*--b = '-';
|
||||
return b;
|
||||
}
|
||||
|
||||
static char * strsep_space( char *string, int * ix)
|
||||
{
|
||||
char *token;
|
||||
|
Reference in New Issue
Block a user