summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/dispatch.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-06-26 09:09:30 +0000
committerjkh <jkh@FreeBSD.org>1996-06-26 09:09:30 +0000
commit4578af9ab6a15e9cee87701b666984ef832db16c (patch)
tree5fd81129732a0ec0a9434a8636b28d6e094fdffa /usr.sbin/sysinstall/dispatch.c
parente5839083912249c09dcf97c128cd4c1d4671910f (diff)
downloadFreeBSD-src-4578af9ab6a15e9cee87701b666984ef832db16c.zip
FreeBSD-src-4578af9ab6a15e9cee87701b666984ef832db16c.tar.gz
Allow argv[0] to be a command also.
Diffstat (limited to 'usr.sbin/sysinstall/dispatch.c')
-rw-r--r--usr.sbin/sysinstall/dispatch.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/dispatch.c b/usr.sbin/sysinstall/dispatch.c
index 8a51ade..ebf0d4e 100644
--- a/usr.sbin/sysinstall/dispatch.c
+++ b/usr.sbin/sysinstall/dispatch.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: dispatch.c,v 1.1 1996/05/16 11:47:27 jkh Exp $
+ * $Id: dispatch.c,v 1.2 1996/06/08 09:08:38 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -107,12 +107,16 @@ int
dispatchCommand(char *str)
{
int i;
+ char *cp;
if (!str || !*str) {
msgConfirm("Null or zero-length string passed to dispatchCommand");
return DITEM_FAILURE;
}
- else if (index(str, '=')) {
+ /* A command might be a pathname if it's encoded in argv[0], as we also support */
+ if ((cp = index(str, '/')) != NULL)
+ str = cp + 1;
+ if (index(str, '=')) {
variable_set(str);
return DITEM_SUCCESS;
}
OpenPOWER on IntegriCloud