From owner-svn-src-stable@FreeBSD.ORG Sun Nov 11 23:29:45 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB96F447; Sun, 11 Nov 2012 23:29:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BE64A8FC08; Sun, 11 Nov 2012 23:29:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qABNTjcs016531; Sun, 11 Nov 2012 23:29:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qABNTjqs016530; Sun, 11 Nov 2012 23:29:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211112329.qABNTjqs016530@svn.freebsd.org> From: Devin Teske Date: Sun, 11 Nov 2012 23:29:45 +0000 (UTC) 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 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2012 23:29:45 -0000 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