Author: mladen.turk(a)jboss.com
Date: 2007-09-03 02:43:20 -0400 (Mon, 03 Sep 2007)
New Revision: 963
Modified:
trunk/sight/native/share/hash.c
Log:
Result from trim is NULL for empty strings
Modified: trunk/sight/native/share/hash.c
===================================================================
--- trunk/sight/native/share/hash.c 2007-09-03 06:38:58 UTC (rev 962)
+++ trunk/sight/native/share/hash.c 2007-09-03 06:43:20 UTC (rev 963)
@@ -208,19 +208,15 @@
char *val = NULL;
char *key = NULL;
pline = sight_trim(&line[0]);
- if (*pline && *pline != '#') {
+ if (pline && *pline != '#') {
if ((first = strchr(pline, sep)) != NULL) {
*first++ = '\0';
key = sight_rtrim(pline);
val = sight_ltrim(first);
}
- if (key && *key) {
- key = apr_pstrdup(ctx, key);
- if (val && *val)
- val = apr_pstrdup(ctx, val);
- else
- val = NULL;
- apr_table_addn(t, key, val);
+ if (key) {
+ /* We can have NULL values for valid keys */
+ apr_table_add(t, key, val);
}
}
}
Show replies by date