aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-11-22 07:41:00 +0000
committerEric Andersen <andersen@codepoet.org>1999-11-22 07:41:00 +0000
commitcb41c2e83b9e9997b9737d7061d53f7c11a463a8 (patch)
tree9fed0b9a9a44389618c13d8094b26224355d3108
parent5d44d1fda593248c154ec68b38ce946a69f9b0fc (diff)
downloadbusybox-w32-cb41c2e83b9e9997b9737d7061d53f7c11a463a8.tar.gz
busybox-w32-cb41c2e83b9e9997b9737d7061d53f7c11a463a8.tar.bz2
busybox-w32-cb41c2e83b9e9997b9737d7061d53f7c11a463a8.zip
Bug fixes
-rwxr-xr-xapplets/install.sh6
-rw-r--r--coreutils/dd.c5
-rw-r--r--coreutils/mkdir.c14
-rw-r--r--dd.c5
-rwxr-xr-xinstall.sh6
-rw-r--r--mkdir.c14
-rw-r--r--utility.c8
7 files changed, 35 insertions, 23 deletions
diff --git a/applets/install.sh b/applets/install.sh
index 4c2a4f1b8..458e65ce9 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -12,11 +12,11 @@ h=`sort busybox.links | uniq`
12for i in $h ; do 12for i in $h ; do
13 mypath=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\1/g' `; 13 mypath=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\1/g' `;
14 myapp=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\2/g' `; 14 myapp=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\2/g' `;
15 mkdir -p $1$mypath
16 echo " $1$mypath$myapp -> /bin/busybox" 15 echo " $1$mypath$myapp -> /bin/busybox"
17 (cd $1$mypath ; rm -f $1$mypath$myapp ; ln -s /bin/busybox $1$mypath$myapp ) 16 mkdir -p $1$mypath
17 (cd $1$mypath && rm -f $1$mypath$myapp && ln -s /bin/busybox $1$mypath$myapp )
18done 18done
19rm -f $1/bin/busybox 19rm -f $1/bin/busybox
20install -m 755 busybox $1/bin/busybox 20install -m 755 busybox $1/bin/busybox
21 21
22 22exit 0
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 64948571c..a2dc1c396 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -29,10 +29,15 @@
29 29
30 30
31#include "internal.h" 31#include "internal.h"
32#include <features.h>
32#include <stdio.h> 33#include <stdio.h>
33#include <fcntl.h> 34#include <fcntl.h>
34#include <errno.h> 35#include <errno.h>
36#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)
35#include <inttypes.h> 37#include <inttypes.h>
38#else
39typedef unsigned long long int uintmax_t;
40#endif
36 41
37static const char dd_usage[] = 42static const char dd_usage[] =
38"dd [if=name] [of=name] [bs=n] [count=n]\n\n" 43"dd [if=name] [of=name] [bs=n] [count=n]\n\n"
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 2cd178805..9ea3b4ea0 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -80,17 +80,21 @@ extern int mkdir_main(int argc, char **argv)
80 while (argc > 0) { 80 while (argc > 0) {
81 int status; 81 int status;
82 struct stat statBuf; 82 struct stat statBuf;
83 status=stat(*argv, &statBuf); 83 char buf[NAME_MAX];
84
85 strcpy (buf, *argv);
86 status=stat(buf, &statBuf);
84 if (status != -1 && status != ENOENT ) { 87 if (status != -1 && status != ENOENT ) {
85 fprintf(stderr, "%s: File exists\n", *argv); 88 fprintf(stderr, "%s: File exists\n", buf);
86 exit( FALSE); 89 exit( FALSE);
87 } 90 }
88 if (parentFlag == TRUE) { 91 if (parentFlag == TRUE) {
89 createPath(*argv, mode); 92 strcat( buf, "/");
93 createPath(buf, mode);
90 } 94 }
91 else { 95 else {
92 if (mkdir (*argv, mode) != 0) { 96 if (mkdir (buf, mode) != 0) {
93 perror(*argv); 97 perror(buf);
94 exit( FALSE); 98 exit( FALSE);
95 } 99 }
96 } 100 }
diff --git a/dd.c b/dd.c
index 64948571c..a2dc1c396 100644
--- a/dd.c
+++ b/dd.c
@@ -29,10 +29,15 @@
29 29
30 30
31#include "internal.h" 31#include "internal.h"
32#include <features.h>
32#include <stdio.h> 33#include <stdio.h>
33#include <fcntl.h> 34#include <fcntl.h>
34#include <errno.h> 35#include <errno.h>
36#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)
35#include <inttypes.h> 37#include <inttypes.h>
38#else
39typedef unsigned long long int uintmax_t;
40#endif
36 41
37static const char dd_usage[] = 42static const char dd_usage[] =
38"dd [if=name] [of=name] [bs=n] [count=n]\n\n" 43"dd [if=name] [of=name] [bs=n] [count=n]\n\n"
diff --git a/install.sh b/install.sh
index 4c2a4f1b8..458e65ce9 100755
--- a/install.sh
+++ b/install.sh
@@ -12,11 +12,11 @@ h=`sort busybox.links | uniq`
12for i in $h ; do 12for i in $h ; do
13 mypath=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\1/g' `; 13 mypath=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\1/g' `;
14 myapp=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\2/g' `; 14 myapp=`echo $i | sed -e 's/\(^.*\/\)\(.*\)/\2/g' `;
15 mkdir -p $1$mypath
16 echo " $1$mypath$myapp -> /bin/busybox" 15 echo " $1$mypath$myapp -> /bin/busybox"
17 (cd $1$mypath ; rm -f $1$mypath$myapp ; ln -s /bin/busybox $1$mypath$myapp ) 16 mkdir -p $1$mypath
17 (cd $1$mypath && rm -f $1$mypath$myapp && ln -s /bin/busybox $1$mypath$myapp )
18done 18done
19rm -f $1/bin/busybox 19rm -f $1/bin/busybox
20install -m 755 busybox $1/bin/busybox 20install -m 755 busybox $1/bin/busybox
21 21
22 22exit 0
diff --git a/mkdir.c b/mkdir.c
index 2cd178805..9ea3b4ea0 100644
--- a/mkdir.c
+++ b/mkdir.c
@@ -80,17 +80,21 @@ extern int mkdir_main(int argc, char **argv)
80 while (argc > 0) { 80 while (argc > 0) {
81 int status; 81 int status;
82 struct stat statBuf; 82 struct stat statBuf;
83 status=stat(*argv, &statBuf); 83 char buf[NAME_MAX];
84
85 strcpy (buf, *argv);
86 status=stat(buf, &statBuf);
84 if (status != -1 && status != ENOENT ) { 87 if (status != -1 && status != ENOENT ) {
85 fprintf(stderr, "%s: File exists\n", *argv); 88 fprintf(stderr, "%s: File exists\n", buf);
86 exit( FALSE); 89 exit( FALSE);
87 } 90 }
88 if (parentFlag == TRUE) { 91 if (parentFlag == TRUE) {
89 createPath(*argv, mode); 92 strcat( buf, "/");
93 createPath(buf, mode);
90 } 94 }
91 else { 95 else {
92 if (mkdir (*argv, mode) != 0) { 96 if (mkdir (buf, mode) != 0) {
93 perror(*argv); 97 perror(buf);
94 exit( FALSE); 98 exit( FALSE);
95 } 99 }
96 } 100 }
diff --git a/utility.c b/utility.c
index 004864a18..011c0cf41 100644
--- a/utility.c
+++ b/utility.c
@@ -481,14 +481,8 @@ extern void createPath (const char *name, int mode)
481 char *cpOld; 481 char *cpOld;
482 char buf[NAME_MAX]; 482 char buf[NAME_MAX];
483 483
484 strcpy (buf, name); 484 strcpy( buf, name);
485 if (buf[strlen(buf)]!='/') {
486 buf[strlen(buf)] = '/';
487 buf[strlen(buf)+1] = '\0';
488 }
489
490 cp = strchr (buf, '/'); 485 cp = strchr (buf, '/');
491
492 while (cp) { 486 while (cp) {
493 cpOld = cp; 487 cpOld = cp;
494 cp = strchr (cp + 1, '/'); 488 cp = strchr (cp + 1, '/');