summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-07-21 05:53:23 +0000
committerPaul Smith <psmith@gnu.org>1999-07-21 05:53:23 +0000
commit588da9812e055fbceb900c350ab406f97eccbf37 (patch)
treecc291944695d7e922ac93c5ae293289349acd7d5 /variable.c
parent73846549f62b832ca6ff761ad3640a86d3b32c86 (diff)
downloadgunmake-588da9812e055fbceb900c350ab406f97eccbf37.tar.gz
* Add configure option to enable dmalloc library.
* Various code cleanups.
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/variable.c b/variable.c
index 2d4fa4d..5379cd5 100644
--- a/variable.c
+++ b/variable.c
@@ -77,7 +77,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
for (v = set->table[hashval]; v != 0; v = v->next)
if (*v->name == *name
- && !strncmp (v->name + 1, name + 1, length - 1)
+ && strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == '\0')
break;
@@ -98,7 +98,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
{
if (v->value != 0)
free (v->value);
- v->value = savestring (value, strlen (value));
+ v->value = xstrdup (value);
v->origin = origin;
v->recursive = recursive;
}
@@ -109,7 +109,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
v = (struct variable *) xmalloc (sizeof (struct variable));
v->name = savestring (name, length);
- v->value = savestring (value, strlen (value));
+ v->value = xstrdup (value);
v->origin = origin;
v->recursive = recursive;
v->expanding = 0;
@@ -176,7 +176,7 @@ lookup_variable (name, length)
for (v = set->table[hashval]; v != 0; v = v->next)
if (*v->name == *name
- && !strncmp (v->name + 1, name + 1, length - 1)
+ && strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == 0)
return v;
}
@@ -205,7 +205,7 @@ lookup_variable_in_set (name, length, set)
for (v = set->table[hash]; v != 0; v = v->next)
if (*v->name == *name
- && !strncmp (v->name + 1, name + 1, length - 1)
+ && strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == 0)
return v;
@@ -446,7 +446,7 @@ define_automatic_variables ()
{
free (v->value);
v->origin = o_file;
- v->value = savestring (default_shell, strlen (default_shell));
+ v->value = xstrdup (default_shell);
}
#endif