From 217849b2a31eb8a1415487a3f62cdda10f1548bd Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 7 Oct 2018 05:23:20 +0000 Subject: [PATCH] OSD strtoken maintenance git-svn-id: https://svn.eduke32.com/eduke32@7040 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/osd.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/build/src/osd.cpp b/source/build/src/osd.cpp index 5d85d167b..c53a5516e 100644 --- a/source/build/src/osd.cpp +++ b/source/build/src/osd.cpp @@ -708,7 +708,7 @@ void OSD_Init(void) }; for (unsigned i=0; iflags & OSD_DRAW ? 0 : 1); + OSD_ShowDisplay((osd->flags & OSD_DRAW) ? 0 : 1); if (osdrowscur == osd->draw.rows) osd->draw.scrolling = 0; @@ -1725,20 +1725,18 @@ void OSD_DispatchQueued(void) static char *strtoken(char *s, char **ptrptr, int32_t *restart) { - char *p, *p2, *start; - *restart = 0; if (!ptrptr) return NULL; // if s != NULL, we process from the start of s, otherwise // we just continue with where ptrptr points to - if (s) p = s; - else p = *ptrptr; + + char *p = s ? s : *ptrptr; if (!p) return NULL; // eat up any leading whitespace - while (*p && *p == ' ') p++; + while (*p == ' ') p++; // a semicolon is an end of statement delimiter like a \0 is, so we signal // the caller to 'restart' for the rest of the string pointed at by *ptrptr @@ -1755,11 +1753,13 @@ static char *strtoken(char *s, char **ptrptr, int32_t *restart) return NULL; } + char *start; + if (*p == '\"') { // quoted string start = ++p; - p2 = p; + char *p2 = p; while (*p != 0) { if (*p == '\"')