summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2003-01-27 03:39:33 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2003-01-27 03:39:33 +0000
commit5fe03aba3730a59ed55fe0eb72bf77e5a3a288eb (patch)
tree4bed4faf934dfbf14110e7b7997083132aca15f9
parent33a155e400ad53ef923e902dad4881909677f005 (diff)
Notes
-rw-r--r--lib/libutil/property.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/libutil/property.c b/lib/libutil/property.c
index 0a31879ab609..34e6ee39b8d1 100644
--- a/lib/libutil/property.c
+++ b/lib/libutil/property.c
@@ -216,20 +216,23 @@ properties_read(int fd)
break;
}
}
+ if (head == NULL && (head = property_alloc(NULL, NULL)) == NULL)
+ return (NULL);
+
return (head);
}
char *
property_find(properties list, const char *name)
{
- if (!list || !name || !name[0])
- return NULL;
- while (list) {
- if (!strcmp(list->name, name))
- return list->value;
+ if (list == NULL || name == NULL || !name[0])
+ return (NULL);
+ while (list != NULL) {
+ if (list->name != NULL && strcmp(list->name, name) == 0)
+ return (list->value);
list = list->next;
}
- return NULL;
+ return (NULL);
}
void