foxygit / doom Log in
commit 1bcdb39fd1b273941c493be9259b44c8560b5d16
Merge: bab992ea df292a6d
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Sep 11 23:07:23 2011 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Sep 11 23:07:23 2011 +0000

    Merge from trunk.

    Subversion-branch: /branches/raven-branch
    Subversion-revision: 2365

 COPYING                         | 41 ++++++++++++++++++++---------------------
 NEWS                            |  6 ++++++
 configure.in                    |  1 +
 data/Makefile.am                |  4 ++--
 data/README                     |  4 ++++
 src/Makefile.am                 | 12 ++++++------
 src/d_iwad.c                    | 18 ++++++++++--------
 src/doom-screensaver.desktop.in |  4 ++--
 src/i_system.c                  |  1 +
 9 files changed, 52 insertions(+), 39 deletions(-)

diff --cc src/Makefile.am
index 746a015b,40be7787..42e266cb
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@@ -210,8 -202,8 +210,8 @@@ screensaver_DATA = @PROGRAM_PREFIX@doom

  if HAVE_PYTHON

 -icon.c : ../data/doom8.ico
 -	../data/convert-icon $< $@
 +icon.c : $(top_builddir)/data/doom8.ico
- 	$(top_builddir)/data/convert-icon $^ $@
++	$(top_builddir)/data/convert-icon $< $@

  endif

diff --cc src/d_iwad.c
index 5cc31738,be5a3880..12a7ada2
--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@@ -418,33 -427,30 +418,35 @@@ static char *SearchDirectoryForIWAD(cha
  // When given an IWAD with the '-iwad' parameter,
  // attempt to identify it by its name.

 -static void IdentifyIWADByName(char *name)
 +static GameMission_t IdentifyIWADByName(char *name, int mask)
  {
      size_t i;
 +    GameMission_t mission;
+     char *p;
+
 -    // Trim down the name to just the filename, ignoring the path.
 -
+     p = strrchr(name, DIR_SEPARATOR);
+
+     if (p != NULL)
+     {
+         name = p + 1;
+     }

 -    gamemission = none;
 +    mission = none;

      for (i=0; i<arrlen(iwads); ++i)
      {
-         char *iwadname;
+         // Check if the filename is this IWAD name.

 -        if (!strcasecmp(name, DEH_String(iwads[i].name)))
 +        // Only use supported missions:
 +
 +        if (((1 << iwads[i].mission) & mask) == 0)
 +            continue;
 +
-         iwadname = DEH_String(iwads[i].name);
-
-         if (strlen(name) < strlen(iwadname))
-             continue;
-
 +        // Check if it ends in this IWAD name.
 +
-         if (!strcasecmp(name + strlen(name) - strlen(iwadname),
-                         iwadname))
++        if (!strcasecmp(name, iwadname))
          {
 -            CheckSpecialIWADs(iwads[i].name);
 -            gamemission = iwads[i].mission;
 +            mission = iwads[i].mission;
              break;
          }
      }