From 4337045e517049bf38b46745a55e30a0ba83ea29 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 29 Jul 2014 17:50:32 +0000 Subject: [PATCH] Show an error message when a command name cannot be parsed, e.g. when it starts with an unmatched quote. Also use the same error code as AOS in this case. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@49185 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/c/Shell/convertLine.c | 8 +++++--- workbench/c/Shell/shell.conf | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/workbench/c/Shell/convertLine.c b/workbench/c/Shell/convertLine.c index d6996ebea9..6d03b4248e 100644 --- a/workbench/c/Shell/convertLine.c +++ b/workbench/c/Shell/convertLine.c @@ -115,7 +115,8 @@ static LONG readCommandR(ShellState *ss, Buffer *in, Buffer *out, case ITEM_NOTHING: return 0; default: - return ERROR_LINE_TOO_LONG; /* invalid argument */ + PutStr("Error in command name\n"); + return ERROR_OBJECT_NOT_FOUND; } /* Is this command an alias ? */ @@ -231,7 +232,7 @@ LONG convertLine(ShellState *ss, Buffer *in, Buffer *out, BOOL *haveCommand) signs subtitution. <$$> and Variables and BackTicks need to be handled only once per line, but in right order: Commodore's DPAT script builds an - environment variable per script used, by including the current CLi's + environment variable per script used, by including the current CLI's number in the variable name: $qw{$$} so we must first handle CLI number substitution, then extract variables, and then handle BackTicks nested commands. @@ -265,7 +266,8 @@ LONG convertLine(ShellState *ss, Buffer *in, Buffer *out, BOOL *haveCommand) D(bug("[convertLine] Pass 4: on (%s)\n", out->buf)); if ((error = readCommand(ss, out, in))) { - D(bug("[convertLine] Pass 4: Error %lu parsing aliases\n", error)); + D(bug("[convertLine] Pass 4: Error %lu parsing command/aliases\n", + error)); return error; } diff --git a/workbench/c/Shell/shell.conf b/workbench/c/Shell/shell.conf index da2cb79357..13e0e058da 100644 --- a/workbench/c/Shell/shell.conf +++ b/workbench/c/Shell/shell.conf @@ -1,5 +1,5 @@ ##begin config -version 41.2 +version 41.3 libbase Shell residentpri -123 options noexpunge -- 2.11.4.GIT