diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-03-23 01:09:18 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-03-23 01:09:18 +0000 |
commit | 298854f02963bd8e43dfeb7224d88cfeb0c932cb (patch) | |
tree | 7a2fbb55e55f980edddb0d627c3f3e79c8f793b0 /coreutils | |
parent | ec5bd90916b6e815a36c14ac04d1b78e3e487400 (diff) | |
download | busybox-w32-298854f02963bd8e43dfeb7224d88cfeb0c932cb.tar.gz busybox-w32-298854f02963bd8e43dfeb7224d88cfeb0c932cb.tar.bz2 busybox-w32-298854f02963bd8e43dfeb7224d88cfeb0c932cb.zip |
My latest ramblings.
-Erik
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/date.c | 4 | ||||
-rw-r--r-- | coreutils/dd.c | 24 | ||||
-rw-r--r-- | coreutils/ls.c | 5 | ||||
-rw-r--r-- | coreutils/tee.c | 6 |
4 files changed, 23 insertions, 16 deletions
diff --git a/coreutils/date.c b/coreutils/date.c index 652db8d74..199a894c0 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -202,8 +202,8 @@ int date_main(int argc, char **argv) | |||
202 | usage(date_usage); | 202 | usage(date_usage); |
203 | } | 203 | } |
204 | } else { | 204 | } else { |
205 | if ((date_fmt == NULL) && (strcmp(*argv, "+") == 0)) | 205 | if ((date_fmt == NULL) && (**argv == '+')) |
206 | date_fmt = *argv; | 206 | date_fmt = *argv + 1; /* Skip over the '+' */ |
207 | else if (date_str == NULL) { | 207 | else if (date_str == NULL) { |
208 | set_time = 1; | 208 | set_time = 1; |
209 | date_str = *argv; | 209 | date_str = *argv; |
diff --git a/coreutils/dd.c b/coreutils/dd.c index f40dec712..d50cf746b 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -125,9 +125,12 @@ extern int dd_main(int argc, char **argv) | |||
125 | inFd = open(inFile, 0); | 125 | inFd = open(inFile, 0); |
126 | 126 | ||
127 | if (inFd < 0) { | 127 | if (inFd < 0) { |
128 | perror(inFile); | 128 | /* Note that we are not freeing buf or closing |
129 | free(buf); | 129 | * files here to save a few bytes. This exits |
130 | exit(FALSE); | 130 | * here anyways... */ |
131 | |||
132 | /* free(buf); */ | ||
133 | fatalError( inFile); | ||
131 | } | 134 | } |
132 | 135 | ||
133 | if (outFile == NULL) | 136 | if (outFile == NULL) |
@@ -136,10 +139,13 @@ extern int dd_main(int argc, char **argv) | |||
136 | outFd = open(outFile, O_WRONLY | O_CREAT | O_TRUNC, 0666); | 139 | outFd = open(outFile, O_WRONLY | O_CREAT | O_TRUNC, 0666); |
137 | 140 | ||
138 | if (outFd < 0) { | 141 | if (outFd < 0) { |
139 | perror(outFile); | 142 | /* Note that we are not freeing buf or closing |
140 | close(inFd); | 143 | * files here to save a few bytes. This exits |
141 | free(buf); | 144 | * here anyways... */ |
142 | exit(FALSE); | 145 | |
146 | /* close(inFd); | ||
147 | free(buf); */ | ||
148 | fatalError( outFile); | ||
143 | } | 149 | } |
144 | 150 | ||
145 | lseek(inFd, skipBlocks * blockSize, SEEK_SET); | 151 | lseek(inFd, skipBlocks * blockSize, SEEK_SET); |
@@ -180,9 +186,13 @@ extern int dd_main(int argc, char **argv) | |||
180 | perror(inFile); | 186 | perror(inFile); |
181 | 187 | ||
182 | cleanup: | 188 | cleanup: |
189 | /* Note that we are not freeing memory or closing | ||
190 | * files here, to save a few bytes. */ | ||
191 | #if 0 | ||
183 | close(inFd); | 192 | close(inFd); |
184 | close(outFd); | 193 | close(outFd); |
185 | free(buf); | 194 | free(buf); |
195 | #endif | ||
186 | 196 | ||
187 | printf("%ld+%d records in\n", (long) (intotal / blockSize), | 197 | printf("%ld+%d records in\n", (long) (intotal / blockSize), |
188 | (intotal % blockSize) != 0); | 198 | (intotal % blockSize) != 0); |
diff --git a/coreutils/ls.c b/coreutils/ls.c index c2266f533..c4856cb71 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -70,11 +70,6 @@ | |||
70 | #define APPCHAR(mode) ("\0|\0\0/\0\0\0\0\0@\0=\0\0\0" [TYPEINDEX(mode)]) | 70 | #define APPCHAR(mode) ("\0|\0\0/\0\0\0\0\0@\0=\0\0\0" [TYPEINDEX(mode)]) |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | #ifndef MAJOR | ||
74 | #define MAJOR(dev) (((dev)>>8)&0xff) | ||
75 | #define MINOR(dev) ((dev)&0xff) | ||
76 | #endif | ||
77 | |||
78 | #define FMT_AUTO 0 | 73 | #define FMT_AUTO 0 |
79 | #define FMT_LONG 1 /* one record per line, extended info */ | 74 | #define FMT_LONG 1 /* one record per line, extended info */ |
80 | #define FMT_SINGLE 2 /* one record per line */ | 75 | #define FMT_SINGLE 2 /* one record per line */ |
diff --git a/coreutils/tee.c b/coreutils/tee.c index a3a1c8132..018fe117b 100644 --- a/coreutils/tee.c +++ b/coreutils/tee.c | |||
@@ -125,8 +125,10 @@ int tee_main(int argc, char **argv) | |||
125 | 125 | ||
126 | /* clean up */ | 126 | /* clean up */ |
127 | FL_apply(tee_fclose, 0); | 127 | FL_apply(tee_fclose, 0); |
128 | free(FileList); | 128 | /* Don't bother to close files Exit does that |
129 | * automagically, so we can save a few bytes */ | ||
130 | /* free(FileList); */ | ||
129 | exit(0); | 131 | exit(0); |
130 | } | 132 | } |
131 | 133 | ||
132 | /* $Id: tee.c,v 1.7 2000/03/08 00:14:35 beppu Exp $ */ | 134 | /* $Id: tee.c,v 1.8 2000/03/23 01:09:18 erik Exp $ */ |