Fix kdrive command line parser.
This commit is contained in:
parent
f3955c0a02
commit
600ef07113
|
@ -1233,14 +1233,17 @@ KdParsePointer (char *arg)
|
||||||
bzero(newopt, sizeof (InputOption));
|
bzero(newopt, sizeof (InputOption));
|
||||||
|
|
||||||
for (tmpo = &options; *tmpo; tmpo = &(*tmpo)->next)
|
for (tmpo = &options; *tmpo; tmpo = &(*tmpo)->next)
|
||||||
|
; /* Hello, I'm here */
|
||||||
|
|
||||||
*tmpo = newopt;
|
*tmpo = newopt;
|
||||||
|
|
||||||
if (strchr(arg, '='))
|
if (strchr(save, '='))
|
||||||
{
|
{
|
||||||
i = (strchr(arg, '=') - arg);
|
i = (strchr(save, '=') - save);
|
||||||
newopt->key = (char *)xalloc(i+1);
|
newopt->key = (char *)xalloc(i);
|
||||||
strncpy(newopt->key, arg, i+1);
|
strncpy(newopt->key, save, i);
|
||||||
newopt->value = xstrdup(strchr(arg, '=') + 1);
|
newopt->key[i] = '\0';
|
||||||
|
newopt->value = xstrdup(strchr(save, '=') + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue