From fdb7d560ac0e7cf6d8288f67d480bcb12ea98a65 Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Wed, 21 Feb 2007 04:47:48 +0000 Subject: [PATCH] A percent sign followed by a space or placed at the end of the line will be parsed to itself --- src/parse.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/parse.c b/src/parse.c index f99957e..ea20044 100644 --- a/src/parse.c +++ b/src/parse.c @@ -716,8 +716,11 @@ process_expression(char *buff, char **bp, char const **str, (*str)++; savec = **str; - if (!savec) + if (!savec) { + /* Line ended in %, so treat it as a literal */ + safe_chr('%', buff, bp); goto exit_sequence; + } savepos = *bp; (*str)++; @@ -725,6 +728,9 @@ process_expression(char *buff, char **bp, char const **str, case '%': /* %% - a real % */ safe_chr('%', buff, bp); break; + case ' ': /* "% " for more natural typing */ + safe_str("% ", buff, bp); + break; case '!': /* executor dbref */ safe_dbref(executor, buff, bp); break; -- 2.30.2