/*****************************************************************************

	SkpCtU()

	This function skipds a control-U command.

*****************************************************************************/

#include "ZPort.h"		/* define portability identifiers */
#include "DefChars.h"		/* define identifiers for characters */
#include "DefError.h"		/* define identifiers for error messages */
#include "DefTeco.h"		/* define general identifiers */

extern	DEFAULT	ErrMsg();	/* display an error message on the terminal */
extern	DEFAULT	FindES();	/* find end of string */

EXTERN	char	*CBfPtr;	/* command buffer pointer */
EXTERN	BYTE	CmdMod;		/* command modifiers flags for @, :, etc. */
EXTERN	char	*CStEnd;	/* pointer to last char of command string */
EXTERN	WORD	MStTop;		/* macro stack top */
EXTERN	BOOLEAN	TraceM;		/* trace mode flag */


DEFAULT SkpCtU()		/* skip control-U command */
{
	LOCAL	BOOLEAN	TTrace;			/* temp: holds trace flag */

	if (CBfPtr == CStEnd)
		if (MStTop < 0)			/* if not in a macro */
			{
			ErrMsg(ERR_UTC);
			return(FAILURE);
			}
		else
			return(SUCCESS);
	++CBfPtr;
	TTrace = TraceM;			/* save trace mode flag */
	TraceM = NO;				/* keep FindES from tracing */
	if (FindES(ESCAPE) == FAILURE)		/* find end of string */
		{
		TraceM = TTrace;		/* restore trace mode flag */
		return(FAILURE);
		}

	TraceM = TTrace;			/* restore trace mode flag */
	CmdMod = '\0';				/* clear modifiers flags */
	return(SUCCESS);
}
