summaryrefslogtreecommitdiff
path: root/games-misc/fortune-mod/files/01_all_fortune_all-fix.patch
blob: 48807293bf1a227de5439d1c08ffd01fcc63d67c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- a/fortune/fortune.c
+++ b/fortune/fortune.c
@@ -974,7 +974,7 @@
 	  if (!ret)
 	    ret=add_file(percent, fullpathname, NULL, &File_list,
 			 &File_tail, NULL);
-	  if ( (!ret && fullpathname != locpathname) || strcmp(sp, "all") == 0 )
+	  if (!ret && strncmp(fullpathname, locpathname, sizeof(fullpathname)))
 	    ret=add_file(percent, locpathname, NULL, &File_list,
 		         &File_tail, NULL);
 	  
@@ -985,7 +985,8 @@
 	  }
 	  if (!ret)
 	    return FALSE;
-	  
+	  if (strncmp(fullpathname, locpathname, sizeof(fullpathname)) && strcmp(sp, "all") == 0)
+	    add_file(percent, locpathname, NULL, &File_list, &File_tail, NULL);
 	}
 	else
 	  if (!add_file(percent, fullpathname, NULL, &File_list,