Initial commit: Uploaded everything from abs/core
[arch-rock.git] / base / kbd / kbd-1.12-find_map_fix.patch
blobca24703fcb5b72db465213f42350dd11577df599
1 Oh, but I fixed it already. Patch below.
3 Andries
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);
18 if ((secondpass && recdepth) || okdir) {
19 - struct stat statbuf;
20 char *a;
22 a = xmalloc(strlen(dir) + strlen(de->d_name) + 2);
23 @@ -137,6 +137,11 @@
25 sprintf(pathname, "%s/%s", dir, de->d_name);
27 + /* Is this a regular file? */
28 + if (stat(pathname, &statbuf) != 0 ||
29 + !S_ISREG(statbuf.st_mode))
30 + continue;
32 /* Does tail consist of a known suffix and possibly
33 a compression suffix? */
34 for(sp = suf; *sp; sp++) {
37 [pasted and cut from another window, so with whitespace damage]