Просмотр исходного кода

dselect: Do not shadow global thisname variable

Guillem Jover лет назад: 16
Родитель
Сommit
86c90d927b
2 измененных файлов с 11 добавлено и 9 удалено
  1. 6 5
      dselect/basecmds.cc
  2. 5 4
      dselect/pkglist.cc

+ 6 - 5
dselect/basecmds.cc

@@ -99,15 +99,16 @@ int baselist::checksearch(char* str) {
 
 int baselist::matchsearch(int index) {
   int lendiff, searchlen, i;
-  const char* thisname;
+  const char *name;
 
-  thisname=itemname(index);
-  if (!thisname) return 0;	/* Skip things without a name (seperators) */
+  name = itemname(index);
+  if (!name)
+    return 0;	/* Skip things without a name (seperators). */
 
   searchlen=strlen(searchstring);
-  lendiff= strlen(thisname) - searchlen;
+  lendiff = strlen(name) - searchlen;
   for (i=0; i<=lendiff; i++)
-    if (!strncasecmp(thisname + i, searchstring, searchlen))
+    if (!strncasecmp(name + i, searchstring, searchlen))
       return 1;
 
   return 0;

+ 5 - 4
dselect/pkglist.cc

@@ -527,12 +527,13 @@ int packagelist::checksearch(char* rx) {
 }
 
 int packagelist::matchsearch(int index) {
-  const char* thisname;
+  const char *name;
 
-  thisname=itemname(index);
-  if (!thisname) return 0;	/* Skip things without a name (seperators) */
+  name = itemname(index);
+  if (!name)
+    return 0;	/* Skip things without a name (seperators) */
 
-  if (regexec(&searchfsm, thisname, 0, NULL, 0)==0)
+  if (regexec(&searchfsm, name, 0, NULL, 0) == 0)
     return 1;
 
   if (searchdescr) {