Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Nov 2012 23:29:45 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r242902 - stable/9/usr.sbin/sysinstall
Message-ID:  <201211112329.qABNTjqs016530@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Sun Nov 11 23:29:45 2012
New Revision: 242902
URL: http://svnweb.freebsd.org/changeset/base/242902

Log:
  Fix a regression introduced by SVN r211417 that saw the breakage of a feature
  documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
  
  If /usr/sbin/sysinstall is linked to another filename, say
  `/usr/local/bin/configPackages', then the basename will be used
  as an implicit command name.
  
  Reviewed by:	adrian (co-mentor)
  Approved by:	adrian (co-mentor)

Modified:
  stable/9/usr.sbin/sysinstall/main.c

Modified: stable/9/usr.sbin/sysinstall/main.c
==============================================================================
--- stable/9/usr.sbin/sysinstall/main.c	Sun Nov 11 23:25:47 2012	(r242901)
+++ stable/9/usr.sbin/sysinstall/main.c	Sun Nov 11 23:29:45 2012	(r242902)
@@ -165,14 +165,21 @@ main(int argc, char **argv)
 
     /* First, see if we have any arguments to process (and argv[0] counts if it's not "sysinstall") */
     if (!RunningAsInit) {
-	for (i = optionArgs+1; i < argc; i++) {
+	int start_arg;
+
+	if (!strstr(argv[0], "sysinstall"))
+		start_arg = 0;
+	else
+		start_arg = optionArgs + 1;
+
+	for (i = start_arg; i < argc; i++) {
 	    if (DITEM_STATUS(dispatchCommand(argv[i])) != DITEM_SUCCESS)
 		systemShutdown(1);
 	}
 
 	/* If we were given commands to process on the command line, just exit
 	 * now */
-	if (argc > optionArgs+1)
+	if (argc > start_arg)
 	    systemShutdown(0);
     }
     else



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211112329.qABNTjqs016530>