From 0a695da7ff63db049bd48e863be69805e44ff698 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Wed, 20 Sep 2000 13:51:22 +0000 Subject: [PATCH] (xbm_scan): Allow C-style comments. --- src/xfns.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/xfns.c b/src/xfns.c index 8cc65c4c4f2..b3a8129df52 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -6329,6 +6329,8 @@ xbm_scan (s, end, sval, ival) int *ival; { int c; + + loop: /* Skip white space. */ while (*s < end && (c = *(*s)++, isspace (c))) @@ -6391,6 +6393,18 @@ xbm_scan (s, end, sval, ival) *s = *s - 1; c = XBM_TK_IDENT; } + else if (c == '/' && **s == '*') + { + /* C-style comment. */ + ++*s; + while (**s && (**s != '*' || *(*s + 1) != '/')) + ++*s; + if (**s) + { + *s += 2; + goto loop; + } + } return c; } -- 2.39.2