summaryrefslogtreecommitdiff
path: root/geography/gpsdrive/patches/patch-ab
blob: 29c55de3a2fd6d70de70c5d8acfe8412a35a2d42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$NetBSD: patch-ab,v 1.1.1.1 2004/07/26 23:33:35 wiz Exp $

Drew Einhorn's gpsfetchmap.pl enhancements from:

http://s2.selwerd.nl/~dirk-jan/gpsdrive/archive/msg01772.html

also require this patch to support tree'd rather than flap map
driectories.

--- src/gpsdrive.c.orig	Sun Dec  8 09:43:33 2002
+++ src/gpsdrive.c	Wed Jan  8 12:20:48 2003
@@ -2926,12 +2926,22 @@
     }
   for (i = 0; i < nrmaps; i++)
     {
+      /* strip off the path, we just want to check the filename */
+      char *fullname;
+      char *rslash;
+      char *filename;
+
       skip = TRUE;
+
+      fullname = (maps + i)->filename;
+      rslash = strrchr(fullname, '/');
+      filename = rslash == NULL ? fullname : rslash + 1;
+
       if (displaymap_map)
-	if (!(strncmp ((maps + i)->filename, "map_", 4)))
+	if (!(strncmp (filename, "map_", 4)))
 	  skip = FALSE;
       if (displaymap_top)
-	if (!(strncmp ((maps + i)->filename, "top_", 4)))
+	if (!(strncmp (filename, "top_", 4)))
 	  skip = FALSE;
 
       if (skip)
@@ -3101,8 +3111,17 @@
 
   for (i = 0; i < nrmaps; i++)
     {
-      if ((strncmp ((maps + i)->filename, "map_", 4)))
-	if ((strncmp ((maps + i)->filename, "top_", 4)))
+      /* strip off the path, we just want to check the filename */
+      char *fullname;
+      char *rslash;
+      char *filename;
+
+      fullname = (maps + i)->filename;
+      rslash = strrchr(fullname, '/');
+      filename = rslash == NULL ? fullname : rslash + 1;
+
+      if ((strncmp (filename, "map_", 4)))
+	if ((strncmp (filename, "top_", 4)))
 	  {
 	    GString *error;
 	    error = g_string_new (NULL);