diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2008-05-07 14:16:40 +0000 |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2008-05-07 14:16:40 +0000 |
commit | 62bc9a4a4c1ce9669919a7669254fd3ce76251d0 (patch) | |
tree | bc9325f095bae48f43c5d8212b008e4e2504ab57 /patches | |
parent | c76b4141ea5c2b563435b6196e3c724b88385651 (diff) | |
download | ptxdist-62bc9a4a4c1ce9669919a7669254fd3ce76251d0.tar.gz ptxdist-62bc9a4a4c1ce9669919a7669254fd3ce76251d0.tar.xz |
* add patch from upstream to allow tab-completion with symlinks
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@8132 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'patches')
-rw-r--r-- | patches/busybox-1.10.1/generic/busybox-1.10.1-completion.diff | 61 | ||||
-rw-r--r-- | patches/busybox-1.10.1/generic/series | 1 |
2 files changed, 62 insertions, 0 deletions
diff --git a/patches/busybox-1.10.1/generic/busybox-1.10.1-completion.diff b/patches/busybox-1.10.1/generic/busybox-1.10.1-completion.diff new file mode 100644 index 000000000..49cc3e5ea --- /dev/null +++ b/patches/busybox-1.10.1/generic/busybox-1.10.1-completion.diff @@ -0,0 +1,61 @@ +# Submitted by: Wolfram Sang, 2008.05.07 +# +# Description: Fix tab-completion for sym-links (patch from busybox.net) +# +--- busybox-1.10.1/libbb/lineedit.c Sat Apr 19 05:50:33 2008 ++++ busybox-1.10.1-completion/libbb/lineedit.c Thu Apr 24 06:45:39 2008 +@@ -518,8 +518,8 @@ + + for (i = 0; i < npaths; i++) { + dir = opendir(paths[i]); +- if (!dir) /* Don't print an error */ +- continue; ++ if (!dir) ++ continue; /* don't print an error */ + + while ((next = readdir(dir)) != NULL) { + int len1; +@@ -529,18 +529,21 @@ + if (strncmp(str_found, pfind, strlen(pfind))) + continue; + /* not see .name without .match */ +- if (*str_found == '.' && *pfind == 0) { ++ if (*str_found == '.' && *pfind == '\0') { + if (NOT_LONE_CHAR(paths[i], '/') || str_found[1]) + continue; + str_found = ""; /* only "/" */ + } + found = concat_path_file(paths[i], str_found); +- /* hmm, remover in progress? */ +- if (lstat(found, &st) < 0) ++ /* hmm, remove in progress? */ ++ /* NB: stat() first so that we see is it a directory; ++ * but if that fails, use lstat() so that ++ * we still match dangling links */ ++ if (stat(found, &st) && lstat(found, &st)) + goto cont; + /* find with dirs? */ + if (paths[i] != dirbuf) +- strcpy(found, next->d_name); /* only name */ ++ strcpy(found, next->d_name); /* only name */ + + len1 = strlen(found); + found = xrealloc(found, len1 + 2); +@@ -548,7 +551,7 @@ + found[len1+1] = '\0'; + + if (S_ISDIR(st.st_mode)) { +- /* name is directory */ ++ /* name is a directory */ + if (found[len1-1] != '/') { + found[len1] = '/'; + } +@@ -566,7 +569,7 @@ + closedir(dir); + } + if (paths != path1) { +- free(paths[0]); /* allocated memory only in first member */ ++ free(paths[0]); /* allocated memory is only in first member */ + free(paths); + } + #undef dirbuf diff --git a/patches/busybox-1.10.1/generic/series b/patches/busybox-1.10.1/generic/series new file mode 100644 index 000000000..62b8a5393 --- /dev/null +++ b/patches/busybox-1.10.1/generic/series @@ -0,0 +1 @@ +busybox-1.10.1-completion.diff |