diff options
| author | Ron Yorston <rmy@pobox.com> | 2026-09-04 09:27:17 +0100 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2026-09-04 09:27:17 +0100 |
| commit | a7cfac2b372e21950cf8b9e9defff742b92043d8 (patch) | |
| tree | a0b292c4c473412c6c1070d46e9b39384cb4a644 /miscutils | |
| parent | dc703c7272ef1c71c0d43a056e21299d1bb5fea0 (diff) | |
| parent | 74ac096e895acd6b02976bb010e9b3511234e899 (diff) | |
| download | busybox-w32-merge.tar.gz busybox-w32-merge.tar.bz2 busybox-w32-merge.zip | |
Merge branch 'busybox' into mergemerge
Signed-off-by: Ron Yorston <rmy@pobox.com>
Diffstat (limited to '')
| -rw-r--r-- | miscutils/devfsd.c | 4 | ||||
| -rw-r--r-- | miscutils/hdparm.c | 2 | ||||
| -rw-r--r-- | miscutils/less.c | 11 |
3 files changed, 9 insertions, 8 deletions
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index d57691414..e6f01eb6a 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c | |||
| @@ -1016,9 +1016,9 @@ static void restore(char *spath, struct stat source_stat, int rootlen) | |||
| 1016 | dest_stat.st_mode = 0; | 1016 | dest_stat.st_mode = 0; |
| 1017 | dpath = concat_path_file(mount_point, spath + rootlen); | 1017 | dpath = concat_path_file(mount_point, spath + rootlen); |
| 1018 | lstat(dpath, &dest_stat); | 1018 | lstat(dpath, &dest_stat); |
| 1019 | free(dpath); | ||
| 1020 | if (S_ISLNK(source_stat.st_mode) || (source_stat.st_mode & S_ISVTX)) | 1019 | if (S_ISLNK(source_stat.st_mode) || (source_stat.st_mode & S_ISVTX)) |
| 1021 | copy_inode(dpath, &dest_stat, (source_stat.st_mode & ~S_ISVTX), spath, &source_stat); | 1020 | copy_inode(dpath, &dest_stat, (source_stat.st_mode & ~S_ISVTX), spath, &source_stat); |
| 1021 | free(dpath); | ||
| 1022 | 1022 | ||
| 1023 | if (S_ISDIR(source_stat.st_mode)) | 1023 | if (S_ISDIR(source_stat.st_mode)) |
| 1024 | dir_operation(RESTORE, spath, rootlen, NULL); | 1024 | dir_operation(RESTORE, spath, rootlen, NULL); |
| @@ -1271,7 +1271,7 @@ static void dir_operation(int type, const char * dir_name, int var, unsigned lon | |||
| 1271 | 1271 | ||
| 1272 | while ((de = readdir(dp)) != NULL) { | 1272 | while ((de = readdir(dp)) != NULL) { |
| 1273 | 1273 | ||
| 1274 | if (de->d_name && DOT_OR_DOTDOT(de->d_name)) | 1274 | if (DOT_OR_DOTDOT(de->d_name)) |
| 1275 | continue; | 1275 | continue; |
| 1276 | path = concat_path_file(dir_name, de->d_name); | 1276 | path = concat_path_file(dir_name, de->d_name); |
| 1277 | if (lstat(path, &statbuf) == 0) { | 1277 | if (lstat(path, &statbuf) == 0) { |
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index 8b844717f..e07ee6398 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c | |||
| @@ -552,7 +552,7 @@ static void print_ascii(const char *p, int length) | |||
| 552 | 552 | ||
| 553 | length *= 2; | 553 | length *= 2; |
| 554 | /* find first non-space & print it */ | 554 | /* find first non-space & print it */ |
| 555 | while (length && p[ofs] != ' ') { | 555 | while (length && p[ofs] == ' ') { |
| 556 | p++; | 556 | p++; |
| 557 | LE_ONLY(ofs = -ofs;) | 557 | LE_ONLY(ofs = -ofs;) |
| 558 | length--; | 558 | length--; |
diff --git a/miscutils/less.c b/miscutils/less.c index e81130988..521792f2e 100644 --- a/miscutils/less.c +++ b/miscutils/less.c | |||
| @@ -477,7 +477,8 @@ static int at_end(void) | |||
| 477 | */ | 477 | */ |
| 478 | static void read_lines(void) | 478 | static void read_lines(void) |
| 479 | { | 479 | { |
| 480 | int ndelay_set, eagain, fdflags; | 480 | int ndelay_set, eagain; |
| 481 | int UNINITIALIZED_VAR(fdflags, fdflags); | ||
| 481 | char *current_line, *p; | 482 | char *current_line, *p; |
| 482 | int w = width; | 483 | int w = width; |
| 483 | char last_terminated = terminated; | 484 | char last_terminated = terminated; |
| @@ -509,16 +510,16 @@ static void read_lines(void) | |||
| 509 | // Consider these cases: | 510 | // Consider these cases: |
| 510 | // "less FILE": can set O_NONBLOCK on open. | 511 | // "less FILE": can set O_NONBLOCK on open. |
| 511 | // "true | less": can't. | 512 | // "true | less": can't. |
| 512 | // " { less; cat; } <FILE": can't. And must not confuse cat. | 513 | // "{ less; cat; } <FILE": can't. And must not confuse cat. |
| 513 | ndelay_set = -1; // "don't know whether stdin is nonblocking" | 514 | ndelay_set = -1; // "don't know whether stdin is nonblocking" |
| 514 | eagain = 0; | 515 | eagain = 0; |
| 515 | 516 | ||
| 516 | while (1) { /* read lines until we reach cur_fline or wanted_match */ | 517 | while (1) { // read lines until we reach cur_fline or wanted_match |
| 517 | *p = '\0'; | 518 | *p = '\0'; |
| 518 | terminated = 0; | 519 | terminated = 0; |
| 519 | while (1) { /* read chars until we have a line */ | 520 | while (1) { // read chars until we have a line |
| 520 | char c; | 521 | char c; |
| 521 | /* if no unprocessed chars left, eat more */ | 522 | // if no unprocessed chars left, eat more |
| 522 | if (readpos >= read_size) { | 523 | if (readpos >= read_size) { |
| 523 | // Read stdin, temporarily make it nonblocking (if it's not already) | 524 | // Read stdin, temporarily make it nonblocking (if it's not already) |
| 524 | if (ndelay_set < 0) { | 525 | if (ndelay_set < 0) { |
