← Commit list

66e3a222c

Bernhard Reutner-Fischer
Bernhard Reutner-Fischer
2006-06-14
SOURCE BUG Duration: 35s

Subject

- minor shrinkage

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

debianutils/which.c+13 -8
@@ -16,9 +16,15 @@
#include <unistd.h>
#include <sys/stat.h>
+
+static int is_executable_file(const char const * a, struct stat *b)
+{
+ return (!access(a,X_OK) && !stat(a, b) && S_ISREG(b->st_mode));
+}
+
int which_main(int argc, char **argv)
{
- int status = EXIT_SUCCESS;
+ int status;
size_t i, count;
char *path_list;
@@ -63,13 +69,12 @@ int which_main(int argc, char **argv)
count = 5;
}
+ status = EXIT_SUCCESS;
while (argc-- > 0) {
struct stat stat_b;
char *buf;
char *path_n;
- char found = 0;
-#define is_executable_file(a, b) (!access(a,X_OK) && !stat(a, &b) && \
- S_ISREG(b.st_mode))
+ int found = 0;
argv++;
path_n = path_list;
@@ -77,14 +82,14 @@ int which_main(int argc, char **argv)
/* if filename is either absolute or contains slashes,
* stat it */
- if (strchr(buf, '/') != NULL && is_executable_file(buf, stat_b)) {
- found = 1;
+ if (strchr(buf, '/') != NULL && is_executable_file(buf, &stat_b)) {
+ found++;
} else {
/* Couldn't access file and file doesn't contain slashes */
for (i = 0; i < count; i++) {
buf = concat_path_file(path_n, *argv);
- if (is_executable_file(buf, stat_b)) {
- found = 1;
+ if (is_executable_file(buf, &stat_b)) {
+ found++;
break;
}
free(buf);