Blame SOURCES/pinfo-0.6.9-infosuff.patch
|
|
e553a1 |
--- pinfo-0.6.9/src/filehandling_functions.c.infosuff 2006-03-16 16:15:02.000000000 +0100
|
|
|
e553a1 |
+++ pinfo-0.6.9/src/filehandling_functions.c 2006-09-18 14:32:32.000000000 +0200
|
|
|
e553a1 |
@@ -94,6 +94,7 @@
|
|
|
e553a1 |
/* iterate over all files in the directory */
|
|
|
e553a1 |
while ((dp = readdir(dir)) != NULL)
|
|
|
e553a1 |
{
|
|
|
e553a1 |
+ int info_suffix;
|
|
|
e553a1 |
/* use strcat rather than strdup, because xmalloc handles all
|
|
|
e553a1 |
* malloc errors */
|
|
|
e553a1 |
char *thisfile = xmalloc(strlen(dp->d_name)+1);
|
|
|
e553a1 |
@@ -101,7 +102,9 @@
|
|
|
e553a1 |
|
|
|
e553a1 |
/* strip suffixes (so "gcc.info.gz" -> "gcc") */
|
|
|
e553a1 |
strip_compression_suffix(thisfile);
|
|
|
e553a1 |
+ info_suffix = strlen(thisfile);
|
|
|
e553a1 |
strip_info_suffix(thisfile);
|
|
|
e553a1 |
+ info_suffix -= strlen(thisfile);
|
|
|
e553a1 |
|
|
|
e553a1 |
/* compare this file with the file we're looking for */
|
|
|
e553a1 |
if (strcmp(thisfile,bname) == 0)
|
|
|
e553a1 |
@@ -110,7 +113,8 @@
|
|
|
e553a1 |
matched++;
|
|
|
e553a1 |
/* put it in the buffer */
|
|
|
e553a1 |
strncat(Buf, thisfile, 1023-strlen(Buf));
|
|
|
e553a1 |
- strncat(Buf, ".info", 1023-strlen(Buf));
|
|
|
e553a1 |
+ if (info_suffix)
|
|
|
e553a1 |
+ strncat(Buf, ".info", 1023-strlen(Buf));
|
|
|
e553a1 |
|
|
|
e553a1 |
/* clean up, and exit the loop */
|
|
|
e553a1 |
xfree(thisfile);
|