shithub: choc

Download patch

ref: 28c6c516062451900f9efc1cfb758eaab1165bc2
parent: a653fb6e0cfab8b5bbe71ae7652e1a9af810b065
author: Simon Howard <fraggle@gmail.com>
date: Fri Feb 9 22:19:30 EST 2007

Don't prepend a superfluous './' to the path when searching the current
directory for an IWAD.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 833

--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -280,7 +280,14 @@
         
         filename = malloc(strlen(dir) + strlen(iwadname) + 3);
 
-        sprintf(filename, "%s%c%s", dir, DIR_SEPARATOR, iwadname);
+        if (!strcmp(dir, "."))
+        {
+            strcpy(filename, iwadname);
+        }
+        else
+        {
+            sprintf(filename, "%s%c%s", dir, DIR_SEPARATOR, iwadname);
+        }
 
         if (M_FileExists(filename))
         {