diff options
| author | Erik Andersen <andersen@codepoet.org> | 2000-02-07 05:29:42 +0000 |
|---|---|---|
| committer | Erik Andersen <andersen@codepoet.org> | 2000-02-07 05:29:42 +0000 |
| commit | fac10d7c59f7db0facd5fb94de273310b9ec86e6 (patch) | |
| tree | dccf8f905fc5807239883da9fca6597037d487fc /coreutils/date.c | |
| parent | 50bc101b7d6e847a9a0621ca3eb28c7117d095e5 (diff) | |
| download | busybox-w32-fac10d7c59f7db0facd5fb94de273310b9ec86e6.tar.gz busybox-w32-fac10d7c59f7db0facd5fb94de273310b9ec86e6.tar.bz2 busybox-w32-fac10d7c59f7db0facd5fb94de273310b9ec86e6.zip | |
A few minor updates. ;-)
Seriously though, read the Changelog for busybox 0.42,
which this is about to become...
-Erik
Diffstat (limited to 'coreutils/date.c')
| -rw-r--r-- | coreutils/date.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/coreutils/date.c b/coreutils/date.c index 77e7c39db..a3528921d 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
| @@ -20,6 +20,10 @@ | |||
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include "internal.h" | 22 | #include "internal.h" |
| 23 | #define BB_DECLARE_EXTERN | ||
| 24 | #define bb_need_invalid_date | ||
| 25 | #define bb_need_memory_exhausted | ||
| 26 | #include "messages.c" | ||
| 23 | #include <stdlib.h> | 27 | #include <stdlib.h> |
| 24 | #include <errno.h> | 28 | #include <errno.h> |
| 25 | #include <sys/time.h> | 29 | #include <sys/time.h> |
| @@ -59,7 +63,7 @@ date_conv_time(struct tm *tm_time, const char *t_string) { | |||
| 59 | &(tm_time->tm_year)); | 63 | &(tm_time->tm_year)); |
| 60 | 64 | ||
| 61 | if(nr < 4 || nr > 5) { | 65 | if(nr < 4 || nr > 5) { |
| 62 | fprintf(stderr, "date: invalid date `%s'\n", t_string); | 66 | fprintf(stderr, invalid_date, "date", t_string); |
| 63 | exit( FALSE); | 67 | exit( FALSE); |
| 64 | } | 68 | } |
| 65 | 69 | ||
| @@ -152,7 +156,7 @@ date_conv_ftime(struct tm *tm_time, const char *t_string) { | |||
| 152 | 156 | ||
| 153 | } | 157 | } |
| 154 | 158 | ||
| 155 | fprintf(stderr, "date: invalid date `%s'\n", t_string); | 159 | fprintf(stderr, invalid_date, "date", t_string); |
| 156 | 160 | ||
| 157 | exit( FALSE); | 161 | exit( FALSE); |
| 158 | 162 | ||
| @@ -190,7 +194,7 @@ date_main(int argc, char * * argv) | |||
| 190 | case 'u': | 194 | case 'u': |
| 191 | utc = 1; | 195 | utc = 1; |
| 192 | if (putenv ("TZ=UTC0") != 0) { | 196 | if (putenv ("TZ=UTC0") != 0) { |
| 193 | fprintf(stderr,"date: memory exhausted\n"); | 197 | fprintf(stderr, memory_exhausted, "date"); |
| 194 | exit( FALSE); | 198 | exit( FALSE); |
| 195 | } | 199 | } |
| 196 | /* Look ma, no break. Don't fix it either. */ | 200 | /* Look ma, no break. Don't fix it either. */ |
| @@ -204,10 +208,10 @@ date_main(int argc, char * * argv) | |||
| 204 | } | 208 | } |
| 205 | } else { | 209 | } else { |
| 206 | if ( (date_fmt == NULL) && (strcmp(*argv, "+")==0) ) | 210 | if ( (date_fmt == NULL) && (strcmp(*argv, "+")==0) ) |
| 207 | date_fmt = *argv; | 211 | date_fmt=*argv; |
| 208 | else if (date_str == NULL) { | 212 | else if (date_str == NULL) { |
| 209 | set_time = 1; | 213 | set_time = 1; |
| 210 | date_str = *argv; | 214 | date_str=*argv; |
| 211 | } else { | 215 | } else { |
| 212 | usage ( date_usage); | 216 | usage ( date_usage); |
| 213 | } | 217 | } |
| @@ -241,7 +245,7 @@ date_main(int argc, char * * argv) | |||
| 241 | /* Correct any day of week and day of year etc fields */ | 245 | /* Correct any day of week and day of year etc fields */ |
| 242 | tm = mktime(&tm_time); | 246 | tm = mktime(&tm_time); |
| 243 | if (tm < 0 ) { | 247 | if (tm < 0 ) { |
| 244 | fprintf(stderr, "date: invalid date `%s'\n", date_str); | 248 | fprintf(stderr, invalid_date, "date", date_str); |
| 245 | exit( FALSE); | 249 | exit( FALSE); |
| 246 | } | 250 | } |
| 247 | 251 | ||
| @@ -284,4 +288,3 @@ date_main(int argc, char * * argv) | |||
| 284 | exit( TRUE); | 288 | exit( TRUE); |
| 285 | 289 | ||
| 286 | } | 290 | } |
| 287 | |||
