[mythtv] quick patch for xmame 0.62 segfault

Todd Malsbary malsbat at comcast.net
Fri Jan 31 19:19:52 EST 2003


I see this problem has been run into before, so here's an actual patch for
it against mythgame in cvs.  The first change is to fix the segfault that
happened, and the second is to use the correct argument name for the
screenshot directory.  I don't have 0.61 or less to test it against, so
hopefully it doesn't break anybody's setup.

? segfault_0.62.diff
Index: mythgame/mamehandler.cpp
===================================================================
RCS file: /var/lib/cvs/mythgame/mythgame/mamehandler.cpp,v
retrieving revision 1.7
diff -u -r1.7 mamehandler.cpp
--- mythgame/mamehandler.cpp 3 Nov 2002 21:43:19 -0000 1.7
+++ mythgame/mamehandler.cpp 1 Feb 2003 03:06:32 -0000
@@ -106,9 +106,13 @@
                         i++;
                 value[i] = 0;
         }
-        supported_games = atoi(value);
-
         pclose(xmame_info);
+        if (value) {
+         supported_games = atoi(value);
+ } else {
+         return;
+ }
+
         /* Generate the list */
         makecmd_line("-listinfo 2>/dev/null", &infocmd, NULL);
         xmame_info = popen(infocmd, "r");
@@ -758,7 +762,13 @@
         }
         if (!screenshotdir.isEmpty())
         {
-          *exec+= " -screenshotdir ";
+          tmp = general_prefs.xmame_minor;
+          /* The screenshot dir argument name changed in 0.62. */
+          if (!strcmp(tmp, "62")) {
+            *exec+= " -snapshot_directory ";
+          } else {
+            *exec+= " -screenshotdir ";
+          }
           *exec+= screenshotdir;
         }
         if (!general_prefs.highscore_dir.isEmpty())




More information about the mythtv-dev mailing list