Some adjustments, mostly from David McCullough <davidm@lineo.com> to
make busybox be more uClinux friendly. I also adjusted Config.h for uClinux so it will automagically disable apps the arn't going to work without fork() and such. -Erik
This commit is contained in:
@@ -303,6 +303,7 @@ static struct dnode **dnalloc(int num)
|
||||
return(p);
|
||||
}
|
||||
|
||||
#ifdef BB_FEATURE_LS_RECURSIVE
|
||||
static void dfree(struct dnode **dnp)
|
||||
{
|
||||
struct dnode *cur, *next;
|
||||
@@ -318,6 +319,7 @@ static void dfree(struct dnode **dnp)
|
||||
}
|
||||
free(dnp); /* free the array holding the dnode pointers */
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
|
||||
{
|
||||
|
@@ -207,6 +207,8 @@ static int decode (const char *inname,
|
||||
char buf[2 * BUFSIZ];
|
||||
char *outname;
|
||||
int do_base64 = 0;
|
||||
int res;
|
||||
int dofre;
|
||||
|
||||
/* Search for header line. */
|
||||
|
||||
@@ -226,6 +228,7 @@ static int decode (const char *inname,
|
||||
}
|
||||
|
||||
/* If the output file name is given on the command line this rules. */
|
||||
dofre = FALSE;
|
||||
if (forced_outname != NULL)
|
||||
outname = (char *) forced_outname;
|
||||
else {
|
||||
@@ -248,10 +251,11 @@ static int decode (const char *inname,
|
||||
}
|
||||
n = strlen (pw->pw_dir);
|
||||
n1 = strlen (p);
|
||||
outname = (char *) alloca ((size_t) (n + n1 + 2));
|
||||
outname = (char *) xmalloc ((size_t) (n + n1 + 2));
|
||||
memcpy (outname + n + 1, p, (size_t) (n1 + 1));
|
||||
memcpy (outname, pw->pw_dir, (size_t) n);
|
||||
outname[n] = '/';
|
||||
dofre = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,6 +265,8 @@ static int decode (const char *inname,
|
||||
|| chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO))
|
||||
)) {
|
||||
perror_msg("%s", outname); /* */
|
||||
if (dofre)
|
||||
free(outname);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -269,9 +275,12 @@ static int decode (const char *inname,
|
||||
|
||||
/* For each input line: */
|
||||
if (do_base64)
|
||||
return read_base64 (inname);
|
||||
res = read_base64 (inname);
|
||||
else
|
||||
return read_stduu (inname);
|
||||
res = read_stduu (inname);
|
||||
if (dofre)
|
||||
free(outname);
|
||||
return res;
|
||||
}
|
||||
|
||||
int uudecode_main (int argc,
|
||||
|
Reference in New Issue
Block a user