Re: [AD] patch for get_config_string

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Take this one, 
the previos may cause problems.

MfG,
Eduard.
-- 
=====================================================================
Eduard Bloch <eb@xxxxxxxxxx>; HP: http://eduard.bloch.com/edecosi
0xEDF008C5(GnuPG): E6EB 98E2 B885 8FF0 6C04  5C1D E106 481E EDF0 08C5
**
Erwerbsregel 177: Wisse, wer deine Feinde sind. Dann beute sie aus
--- /home/inet/cvs/allegro/src/config.c	Fri Dec  1 16:49:29 2000
+++ config.c	Tue Dec 26 14:17:50 2000
@@ -632,10 +632,15 @@
 	       in_section = (ustricmp(section, p->name) == 0);
 	    }
 	    if ((in_section) || (ugetc(name) == '[')) {
-	       /* is this the one? */
-	       if (ustricmp(p->name, name) == 0)
-		  return p;
-	    }
+          /* is this the one? */
+          if (ustricmp(p->name, name) == 0) {
+             if ((p->data == NULL) || (ustrlen(p->data) == 0))
+                /* check, if entry exists but is undefined */
+                return NULL;
+             else
+                return p;
+          }
+       }
 	 }
 
 	 if (prev)


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/