update Tue Mar 2 18:37:00 PST 2010
[pkgsrc.git] / geography / gpsdrive / patches / patch-ab
1 $NetBSD: patch-ab,v 1.1.1.1 2004/07/26 23:33:35 wiz Exp $
2
3 Drew Einhorn's gpsfetchmap.pl enhancements from:
4
5 http://s2.selwerd.nl/~dirk-jan/gpsdrive/archive/msg01772.html
6
7 also require this patch to support tree'd rather than flap map
8 driectories.
9
10 --- src/gpsdrive.c.orig Sun Dec  8 09:43:33 2002
11 +++ src/gpsdrive.c      Wed Jan  8 12:20:48 2003
12 @@ -2926,12 +2926,22 @@
13      }
14    for (i = 0; i < nrmaps; i++)
15      {
16 +      /* strip off the path, we just want to check the filename */
17 +      char *fullname;
18 +      char *rslash;
19 +      char *filename;
20 +
21        skip = TRUE;
22 +
23 +      fullname = (maps + i)->filename;
24 +      rslash = strrchr(fullname, '/');
25 +      filename = rslash == NULL ? fullname : rslash + 1;
26 +
27        if (displaymap_map)
28 -       if (!(strncmp ((maps + i)->filename, "map_", 4)))
29 +       if (!(strncmp (filename, "map_", 4)))
30           skip = FALSE;
31        if (displaymap_top)
32 -       if (!(strncmp ((maps + i)->filename, "top_", 4)))
33 +       if (!(strncmp (filename, "top_", 4)))
34           skip = FALSE;
35  
36        if (skip)
37 @@ -3101,8 +3111,17 @@
38  
39    for (i = 0; i < nrmaps; i++)
40      {
41 -      if ((strncmp ((maps + i)->filename, "map_", 4)))
42 -       if ((strncmp ((maps + i)->filename, "top_", 4)))
43 +      /* strip off the path, we just want to check the filename */
44 +      char *fullname;
45 +      char *rslash;
46 +      char *filename;
47 +
48 +      fullname = (maps + i)->filename;
49 +      rslash = strrchr(fullname, '/');
50 +      filename = rslash == NULL ? fullname : rslash + 1;
51 +
52 +      if ((strncmp (filename, "map_", 4)))
53 +       if ((strncmp (filename, "top_", 4)))
54           {
55             GString *error;
56             error = g_string_new (NULL);