Magellan Linux

Annotation of /trunk/kbd/patches/kbd-1.12-find-map-fix.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 144 - (hide annotations) (download)
Tue May 8 20:06:05 2007 UTC (17 years, 1 month ago) by niro
File size: 957 byte(s)
-import

1 niro 144 Oh, but I fixed it already. Patch below.
2    
3     Andries
4    
5     --- kbd-1.12.orig/src/findfile.c Fri Jan 16 20:45:31 2004
6     +++ kbd-1.12/src/findfile.c Wed Jan 28 23:29:35 2004
7     @@ -70,6 +70,7 @@
8     FILE *fp = NULL;
9     DIR *d;
10     struct dirent *de;
11     + struct stat statbuf;
12     char *ff, *fdir, *p, *q, **sp;
13     struct decompressor *dc;
14     int secondpass = 0;
15     @@ -104,7 +105,6 @@
16     okdir = (ff && strcmp(de->d_name, fdir) == 0);
17    
18     if ((secondpass && recdepth) || okdir) {
19     - struct stat statbuf;
20     char *a;
21    
22     a = xmalloc(strlen(dir) + strlen(de->d_name) + 2);
23     @@ -137,6 +137,11 @@
24    
25     sprintf(pathname, "%s/%s", dir, de->d_name);
26    
27     + /* Is this a regular file? */
28     + if (stat(pathname, &statbuf) != 0 ||
29     + !S_ISREG(statbuf.st_mode))
30     + continue;
31     +
32     /* Does tail consist of a known suffix and possibly
33     a compression suffix? */
34     for(sp = suf; *sp; sp++) {
35    
36    
37     [pasted and cut from another window, so with whitespace damage]