Stuf
authorEric Andersen <andersen@codepoet.org>
Tue, 23 Nov 1999 21:38:12 +0000 (21:38 -0000)
committerEric Andersen <andersen@codepoet.org>
Tue, 23 Nov 1999 21:38:12 +0000 (21:38 -0000)
Changelog
TODO [new file with mode: 0644]
cat.c
coreutils/cat.c
coreutils/ls.c
ls.c

index 1a7fd715e41b370409b55c6966415b7daf572e90..7a7f50ab6075342897c969627562785821c8cf27 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -6,6 +6,10 @@
        * Several options are now moved into busybox.defs.h
        * Now 'rm -R' and 'rm -r' both work.
        * dd now properly handles input beyond 1 block from stdin.
+       * Fixed a bug where tar unpacked everything a directories. Moved some code 
+           from createPath into mkdir where it belonged, thereby making tar work properly.
+       * Fixed an off-by-one bug in cat.  Given a list of file it wouldn't cat out the
+           last file in the list.
 
        -Erik Andrsen
 
diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..20cd41e
--- /dev/null
+++ b/TODO
@@ -0,0 +1,9 @@
+TODO list for busybox in no particular order
+
+* Add in a mini syslogd
+* Allow tar to create archives with sockets, devices, and other special files
+* Add in a mini modprobe, insmod, rmmod
+* poweroff
+* Change init so halt, reboot (and poweroff) work with an initrd
+    when init is not PID 1
+* 
diff --git a/cat.c b/cat.c
index 1f4ef4af8ddce911d66d54d038ff81051b86ee54..758a83e6bdee7fd416a694cd74cdc6327e76d42e 100644 (file)
--- a/cat.c
+++ b/cat.c
@@ -49,14 +49,12 @@ extern int cat_main(int argc, char **argv)
     argv++;
 
     while (argc-- > 0) {
-       file = fopen(*argv, "r");
+       file = fopen(*(argv++), "r");
        if (file == NULL) {
            perror(*argv);
            exit(FALSE);
        }
        print_file( file);
-       argc--;
-       argv++;
     }
     exit(TRUE);
 }
index 1f4ef4af8ddce911d66d54d038ff81051b86ee54..758a83e6bdee7fd416a694cd74cdc6327e76d42e 100644 (file)
@@ -49,14 +49,12 @@ extern int cat_main(int argc, char **argv)
     argv++;
 
     while (argc-- > 0) {
-       file = fopen(*argv, "r");
+       file = fopen(*(argv++), "r");
        if (file == NULL) {
            perror(*argv);
            exit(FALSE);
        }
        print_file( file);
-       argc--;
-       argv++;
     }
     exit(TRUE);
 }
index 3b380671d1835be17ae45745ec9b37ae5872c561..571c962c708e9e715b667570b31164a87ff0c931 100644 (file)
@@ -193,27 +193,34 @@ static void list_single(const char *name, struct stat *info, const char *fullnam
                fputs(" ", stdout);
 #ifdef BB_FEATURE_LS_USERNAME
                if (!(opts & DISP_NUMERIC)) {
-                       scratch[8]='\0';
+                       scratch[0]='\0';
                        my_getpwuid( scratch, info->st_uid);
+                       scratch[8]='\0';
                        if (*scratch)
-                               fputs(scratch, stdout);
-                       else
-                               writenum((long)info->st_uid,(short)0);
+                               wr(scratch,8);
+                       else {
+                               writenum((long) info->st_uid,(short)8);
+                               fputs(" ", stdout);
+                       }
                } else
 #endif
-               writenum((long)info->st_uid,(short)0);
+               {
+                   writenum((long) info->st_uid,(short)8);
+                   fputs(" ", stdout);
+               }
                tab(16);
 #ifdef BB_FEATURE_LS_USERNAME
                if (!(opts & DISP_NUMERIC)) {
-                       scratch[8]='\0';
+                       scratch[0]='\0';
                        my_getgrgid( scratch, info->st_gid);
+                       scratch[8]='\0';
                        if (*scratch)
-                               fputs(scratch, stdout);
-                       else
-                               writenum((long)info->st_gid,(short)0);
+                               wr(scratch,8);
+                       else 
+                               writenum((long) info->st_gid,(short)8);
                } else
 #endif
-               writenum((long)info->st_gid,(short)0);
+               writenum((long) info->st_gid,(short)8);
                tab(17);
                if (S_ISBLK(mode) || S_ISCHR(mode)) {
                        writenum((long)MAJOR(info->st_rdev),(short)3);
diff --git a/ls.c b/ls.c
index 3b380671d1835be17ae45745ec9b37ae5872c561..571c962c708e9e715b667570b31164a87ff0c931 100644 (file)
--- a/ls.c
+++ b/ls.c
@@ -193,27 +193,34 @@ static void list_single(const char *name, struct stat *info, const char *fullnam
                fputs(" ", stdout);
 #ifdef BB_FEATURE_LS_USERNAME
                if (!(opts & DISP_NUMERIC)) {
-                       scratch[8]='\0';
+                       scratch[0]='\0';
                        my_getpwuid( scratch, info->st_uid);
+                       scratch[8]='\0';
                        if (*scratch)
-                               fputs(scratch, stdout);
-                       else
-                               writenum((long)info->st_uid,(short)0);
+                               wr(scratch,8);
+                       else {
+                               writenum((long) info->st_uid,(short)8);
+                               fputs(" ", stdout);
+                       }
                } else
 #endif
-               writenum((long)info->st_uid,(short)0);
+               {
+                   writenum((long) info->st_uid,(short)8);
+                   fputs(" ", stdout);
+               }
                tab(16);
 #ifdef BB_FEATURE_LS_USERNAME
                if (!(opts & DISP_NUMERIC)) {
-                       scratch[8]='\0';
+                       scratch[0]='\0';
                        my_getgrgid( scratch, info->st_gid);
+                       scratch[8]='\0';
                        if (*scratch)
-                               fputs(scratch, stdout);
-                       else
-                               writenum((long)info->st_gid,(short)0);
+                               wr(scratch,8);
+                       else 
+                               writenum((long) info->st_gid,(short)8);
                } else
 #endif
-               writenum((long)info->st_gid,(short)0);
+               writenum((long) info->st_gid,(short)8);
                tab(17);
                if (S_ISBLK(mode) || S_ISCHR(mode)) {
                        writenum((long)MAJOR(info->st_rdev),(short)3);