[syslinux:master] rosh: Change rosh_help() to use the string passed to it directly

syslinux-bot for Gene Cumm gene.cumm at gmail.com
Sun Nov 14 12:54:48 PST 2010


Commit-ID:  dbc91c69f13a2a120b9fbb8a7078347fc171850d
Gitweb:     http://syslinux.zytor.com/commit/dbc91c69f13a2a120b9fbb8a7078347fc171850d
Author:     Gene Cumm <gene.cumm at gmail.com>
AuthorDate: Sat, 2 Oct 2010 13:20:07 -0400
Committer:  Gene Cumm <gene.cumm at gmail.com>
CommitDate: Sat, 9 Oct 2010 07:33:07 -0400

rosh: Change rosh_help() to use the string passed to it directly



---
 com32/rosh/rosh.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/com32/rosh/rosh.c b/com32/rosh/rosh.c
index c5afaf2..d6a3035 100644
--- a/com32/rosh/rosh.c
+++ b/com32/rosh/rosh.c
@@ -242,20 +242,17 @@ void rosh_pr_argv_v(int argc, char *argv[])
 
 /* Display help
  *	type	Help type
- *	cmdstr	Command string
+ *	cmdstr	Command for which help is requested
  */
 void rosh_help(int type, const char *cmdstr)
 {
-    const char *istr;
-    istr = cmdstr;
     switch (type) {
     case 2:
-	istr += rosh_search_nonsp(cmdstr, rosh_search_sp(cmdstr, 0));
-	if ((cmdstr == NULL) || (strcmp(istr, "") == 0)) {
+	if ((cmdstr == NULL) || (strcmp(cmdstr, "") == 0)) {
 	    rosh_version(0);
 	    puts(rosh_help_str2);
 	} else {
-	    switch (istr[0]) {
+	    switch (cmdstr[0]) {
 	    case 'c':
 		puts(rosh_help_cd_str);
 		break;
@@ -263,7 +260,7 @@ void rosh_help(int type, const char *cmdstr)
 		puts(rosh_help_ls_str);
 		break;
 	    default:
-		printf(rosh_help_str_adv, istr);
+		printf(rosh_help_str_adv, cmdstr);
 	    }
 	}
 	break;
@@ -1209,7 +1206,7 @@ char rosh_command(int argc, char *argv[], const char *ipwdstr)
     case 'H':
     case '?':
 	if ((strncasecmp("help", argv[0], tlen) == 0) || (tlen == 1))
-	    rosh_help(2, cmdstr);
+	    rosh_help(2, argv[1]);
 	else
 	    rosh_help(1, NULL);
 	break;
@@ -1242,7 +1239,7 @@ char rosh_command(int argc, char *argv[], const char *ipwdstr)
 	case 'a':
 	case 'A':
 	    if (strncasecmp("man", argv[0], tlen) == 0)
-		rosh_help(2, cmdstr);
+		rosh_help(2, argv[1]);
 	    else
 		rosh_help(1, NULL);
 	    break;



More information about the Syslinux-commits mailing list