diff options
author | Ron Yorston <rmy@pobox.com> | 2015-07-14 14:12:05 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2015-07-14 14:12:05 +0100 |
commit | 895a1533781ca4713ef92113ab6ac5f2584ddd9d (patch) | |
tree | 49c8602e9cd733e6f6c105e94e614b8236677853 /coreutils | |
parent | 535ec990c50206697852d5c25e94a959f24d86bc (diff) | |
parent | 072fc60f29ee3a4ff38f095a9ef149b2e820c8c0 (diff) | |
download | busybox-w32-895a1533781ca4713ef92113ab6ac5f2584ddd9d.tar.gz busybox-w32-895a1533781ca4713ef92113ab6ac5f2584ddd9d.tar.bz2 busybox-w32-895a1533781ca4713ef92113ab6ac5f2584ddd9d.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/Config.src | 2 | ||||
-rw-r--r-- | coreutils/chown.c | 2 | ||||
-rw-r--r-- | coreutils/ln.c | 1 | ||||
-rw-r--r-- | coreutils/shuf.c | 2 | ||||
-rw-r--r-- | coreutils/stat.c | 2 | ||||
-rw-r--r-- | coreutils/truncate.c | 20 | ||||
-rw-r--r-- | coreutils/uudecode.c | 2 |
7 files changed, 20 insertions, 11 deletions
diff --git a/coreutils/Config.src b/coreutils/Config.src index f15e03990..68857b2cc 100644 --- a/coreutils/Config.src +++ b/coreutils/Config.src | |||
@@ -11,7 +11,7 @@ config CAL | |||
11 | bool "cal" | 11 | bool "cal" |
12 | default y | 12 | default y |
13 | help | 13 | help |
14 | cal is used to display a monthly calender. | 14 | cal is used to display a monthly calendar. |
15 | 15 | ||
16 | config CATV | 16 | config CATV |
17 | bool "catv" | 17 | bool "catv" |
diff --git a/coreutils/chown.c b/coreutils/chown.c index cb07bbcbb..679c0d832 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c | |||
@@ -11,7 +11,7 @@ | |||
11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/chown.html */ | 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/chown.html */ |
12 | 12 | ||
13 | //usage:#define chown_trivial_usage | 13 | //usage:#define chown_trivial_usage |
14 | //usage: "[-RhLHP"IF_DESKTOP("cvf")"]... OWNER[<.|:>[GROUP]] FILE..." | 14 | //usage: "[-Rh"IF_DESKTOP("LHPcvf")"]... OWNER[<.|:>[GROUP]] FILE..." |
15 | //usage:#define chown_full_usage "\n\n" | 15 | //usage:#define chown_full_usage "\n\n" |
16 | //usage: "Change the owner and/or group of each FILE to OWNER and/or GROUP\n" | 16 | //usage: "Change the owner and/or group of each FILE to OWNER and/or GROUP\n" |
17 | //usage: "\n -R Recurse" | 17 | //usage: "\n -R Recurse" |
diff --git a/coreutils/ln.c b/coreutils/ln.c index 3b822e8c7..168814801 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c | |||
@@ -134,7 +134,6 @@ int ln_main(int argc, char **argv) | |||
134 | } | 134 | } |
135 | 135 | ||
136 | free(src_name); | 136 | free(src_name); |
137 | |||
138 | } while ((++argv)[1]); | 137 | } while ((++argv)[1]); |
139 | 138 | ||
140 | return status; | 139 | return status; |
diff --git a/coreutils/shuf.c b/coreutils/shuf.c index 6d0a68fc1..9f61f2f7d 100644 --- a/coreutils/shuf.c +++ b/coreutils/shuf.c | |||
@@ -94,7 +94,7 @@ int shuf_main(int argc, char **argv) | |||
94 | *dash = '\0'; | 94 | *dash = '\0'; |
95 | lo = xatou(opt_i_str); | 95 | lo = xatou(opt_i_str); |
96 | hi = xatou(dash + 1); | 96 | hi = xatou(dash + 1); |
97 | *dash = '-'; | 97 | *dash = '-'; |
98 | if (hi < lo) { | 98 | if (hi < lo) { |
99 | bb_error_msg_and_die("bad range '%s'", opt_i_str); | 99 | bb_error_msg_and_die("bad range '%s'", opt_i_str); |
100 | } | 100 | } |
diff --git a/coreutils/stat.c b/coreutils/stat.c index 769fac078..f7fd227bb 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c | |||
@@ -374,7 +374,7 @@ static void print_it(const char *masterformat, | |||
374 | { | 374 | { |
375 | /* Create a working copy of the format string */ | 375 | /* Create a working copy of the format string */ |
376 | char *format = xstrdup(masterformat); | 376 | char *format = xstrdup(masterformat); |
377 | /* Add 2 to accomodate our conversion of the stat '%s' format string | 377 | /* Add 2 to accommodate our conversion of the stat '%s' format string |
378 | * to the printf '%llu' one. */ | 378 | * to the printf '%llu' one. */ |
379 | char *dest = xmalloc(strlen(format) + 2 + 1); | 379 | char *dest = xmalloc(strlen(format) + 2 + 1); |
380 | char *b; | 380 | char *b; |
diff --git a/coreutils/truncate.c b/coreutils/truncate.c index 0e36daba3..e5fa656c8 100644 --- a/coreutils/truncate.c +++ b/coreutils/truncate.c | |||
@@ -64,12 +64,22 @@ int truncate_main(int argc UNUSED_PARAM, char **argv) | |||
64 | 64 | ||
65 | argv += optind; | 65 | argv += optind; |
66 | while (*argv) { | 66 | while (*argv) { |
67 | int fd = xopen(*argv, flags); | 67 | int fd = open(*argv, flags); |
68 | if (ftruncate(fd, size) == -1) { | 68 | if (fd < 0) { |
69 | bb_perror_msg("%s: ftruncate", *argv); | 69 | if (errno != ENOENT || !(opts & OPT_NOCREATE)) { |
70 | ret = EXIT_FAILURE; | 70 | bb_perror_msg("%s: open", *argv); |
71 | ret = EXIT_FAILURE; | ||
72 | } | ||
73 | /* else: ENOENT && OPT_NOCREATE: | ||
74 | * do not report error, exitcode is also 0. | ||
75 | */ | ||
76 | } else { | ||
77 | if (ftruncate(fd, size) == -1) { | ||
78 | bb_perror_msg("%s: truncate", *argv); | ||
79 | ret = EXIT_FAILURE; | ||
80 | } | ||
81 | xclose(fd); | ||
71 | } | 82 | } |
72 | xclose(fd); | ||
73 | ++argv; | 83 | ++argv; |
74 | } | 84 | } |
75 | 85 | ||
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 3f1227306..7aa5c67f2 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
@@ -46,7 +46,7 @@ static void FAST_FUNC read_stduu(FILE *src_stream, FILE *dst_stream, int flags U | |||
46 | 46 | ||
47 | encoded_len = line[0] * 4 / 3; | 47 | encoded_len = line[0] * 4 / 3; |
48 | /* Check that line is not too short. (we tolerate | 48 | /* Check that line is not too short. (we tolerate |
49 | * overly _long_ line to accomodate possible extra '`'). | 49 | * overly _long_ line to accommodate possible extra '`'). |
50 | * Empty line case is also caught here. */ | 50 | * Empty line case is also caught here. */ |
51 | if (str_len <= encoded_len) { | 51 | if (str_len <= encoded_len) { |
52 | break; /* go to bb_error_msg_and_die("short file"); */ | 52 | break; /* go to bb_error_msg_and_die("short file"); */ |