svn commit: r242902 - stable/9/usr.sbin/sysinstall

Devin Teske dteske at FreeBSD.org
Sun Nov 11 23:29:45 UTC 2012


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


More information about the svn-src-all mailing list