diff options
author | Jeroen Roovers <jer@gentoo.org> | 2010-11-02 20:12:45 +0000 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2010-11-02 20:12:45 +0000 |
commit | 02529e025e7c2af4cade9ad4d48f0b800c1ed082 (patch) | |
tree | 236c0a92744c4c5f0cb751d5964e841b8b7b8972 /app-text/pinfo/files/pinfo-0.6.10-info-suffix.patch | |
parent | Lastrite acer_acpi and acerhk. (diff) | |
download | gentoo-2-02529e025e7c2af4cade9ad4d48f0b800c1ed082.tar.gz gentoo-2-02529e025e7c2af4cade9ad4d48f0b800c1ed082.tar.bz2 gentoo-2-02529e025e7c2af4cade9ad4d48f0b800c1ed082.zip |
Add patch by Ulrich Müller for bug #306445 by Hartmut Figge.
(Portage version: 2.1.9.24/cvs/Linux i686)
Diffstat (limited to 'app-text/pinfo/files/pinfo-0.6.10-info-suffix.patch')
-rw-r--r-- | app-text/pinfo/files/pinfo-0.6.10-info-suffix.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app-text/pinfo/files/pinfo-0.6.10-info-suffix.patch b/app-text/pinfo/files/pinfo-0.6.10-info-suffix.patch new file mode 100644 index 000000000000..45be53cd1bf6 --- /dev/null +++ b/app-text/pinfo/files/pinfo-0.6.10-info-suffix.patch @@ -0,0 +1,28 @@ +--- a/src/filehandling_functions.c ++++ b/src/filehandling_functions.c +@@ -96,11 +96,14 @@ matchfile(char **buf, char *name) + { + /* use strcat rather than strdup, because xmalloc handles all + * malloc errors */ +- char *thisfile = xmalloc(strlen(dp->d_name)+1); ++ int len = strlen(dp->d_name)+1; ++ char *thisfile = xmalloc(len * 2); ++ char *thisfile_info = thisfile + len; + strcat(thisfile, dp->d_name); + + /* strip suffixes (so "gcc.info.gz" -> "gcc") */ + strip_compression_suffix(thisfile); ++ strcat(thisfile_info, thisfile); + strip_info_suffix(thisfile); + + /* compare this file with the file we're looking for */ +@@ -109,8 +112,7 @@ matchfile(char **buf, char *name) + /* we found a match! */ + matched++; + /* put it in the buffer */ +- strncat(Buf, thisfile, 1023-strlen(Buf)); +- strncat(Buf, ".info", 1023-strlen(Buf)); ++ strncat(Buf, thisfile_info, 1023-strlen(Buf)); + + /* clean up, and exit the loop */ + xfree(thisfile); |