From 130244a3026cbe8b4c6cb8aa9cde60651e00eda6 Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 12 Jan 2015 01:53:55 +0000 Subject: [PATCH] Crash fix git-svn-id: https://svn.eduke32.com/eduke32@4905 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/cache1d.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/src/cache1d.c b/polymer/eduke32/build/src/cache1d.c index b04a97bef..0339078ea 100644 --- a/polymer/eduke32/build/src/cache1d.c +++ b/polymer/eduke32/build/src/cache1d.c @@ -455,10 +455,15 @@ int32_t removesearchpath(const char *p) void removesearchpaths_withuser(int32_t usermask) { - for (searchpath_t *srch = searchpathhead; srch; srch = srch->next) + searchpath_t *next; + + for (searchpath_t *srch = searchpathhead; srch; srch = next) { + next = srch->next; + if (srch->user & usermask) { + if (srch == searchpathhead) searchpathhead = srch->next; else