use m4_normalize on the output strings to remove trailing spaces/tabs and consolidate...
[AROS.git] / workbench / c / shellcommands / EndIf.c
blobba4d9f0b894206689047881a8458bf9e1936d9e9
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 /******************************************************************************
11 NAME
13 EndIf
15 SYNOPSIS
17 LOCATION
21 FUNCTION
23 Ends an If block. If the condition of the If command is false,
24 execution will skip to the corresponding EndIf command, in case there
25 isn't an Else command present.
27 INPUTS
29 RESULT
31 NOTES
33 EXAMPLE
35 BUGS
37 SEE ALSO
39 If, Else
41 INTERNALS
43 HISTORY
45 10.01.2000 SDuvan implemented
47 ******************************************************************************/
49 #include <proto/dos.h>
50 #include <dos/dos.h>
51 #include <dos/dosextens.h>
52 #include "dos_commanderrors.h"
54 #include <aros/shcommands.h>
56 AROS_SH0(EndIf,41.1)
58 AROS_SHCOMMAND_INIT
60 struct CommandLineInterface *cli = Cli();
63 if ((cli != NULL) && (cli->cli_CurrentInput != cli->cli_StandardInput))
65 return RETURN_OK; /* Normal operation: do nothing! */
67 else
69 PrintFault(ERROR_SCRIPT_ONLY, "EndIf");
71 return RETURN_ERROR;
74 AROS_SHCOMMAND_EXIT