From 43aea343ad724da473fba353c52b2d6b9515f886 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Thu, 15 Jun 2017 01:19:34 +0200 Subject: [PATCH] fix at negative index numbers now return "" for now, a warning is printed, if that happens DOCREF at --- source/src/command.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/src/command.cpp b/source/src/command.cpp index 1d203d07..17377bad 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -1207,6 +1207,8 @@ COMMANDF(looplisti, "sss", (char *list, char *varlist, char *body) { looplist(li char *indexlist(const char *s, int pos) { + DEBUGCODE(if(pos < 0) conoutf("\f3warning: negative index for 'at' \"%s\" %d", s, pos);) // FIXME remove this warning before release + if(pos < 0) return newstring(""); whitespaceskip; loopi(pos) {