[mednaffe] 82/99: Ask for an executable when the path saved is not correct

Stephen Kitt skitt at moszumanska.debian.org
Tue Aug 2 21:00:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

skitt pushed a commit to branch master
in repository mednaffe.

commit 02d4e34e44dd8a338c129046f2eb84e640e1c29a
Author: AmatCoder <amatcoder at gmail.com>
Date:   Tue Jul 21 12:06:16 2015 +0200

    Ask for an executable when the path saved is not correct
---
 src/mednaffe.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/mednaffe.c b/src/mednaffe.c
index 2bdd804..059a0f5 100644
--- a/src/mednaffe.c
+++ b/src/mednaffe.c
@@ -495,7 +495,17 @@ int main(int argc, char **argv)
 
  /* Search for mednafen executable */
   if (gui.binpath==NULL)
+  {
     gui.binpath = g_find_program_in_path("mednafen");
+  }
+  else
+  {
+    if (!g_file_test(gui.binpath, G_FILE_TEST_IS_EXECUTABLE))
+    {
+      g_free(gui.binpath);
+      gui.binpath = NULL;
+    }
+  }
   if (gui.binpath==NULL)
   {
     gui.binpath = show_chooser(
@@ -527,7 +537,7 @@ want to select the file manually?\n");
     gchar *qbin = g_strconcat("\"", gui.binpath, "\"", NULL);
     gchar *cfg_path = g_strconcat(home, "\\mednafen-09x.cfg", NULL);
 
-    if ((g_file_get_contents(path, &stout, NULL, NULL)) && 
+    if ((g_file_get_contents(path, &stout, NULL, NULL)) &&
         (g_file_test(cfg_path, G_FILE_TEST_IS_REGULAR)))
     {}
     else

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mednaffe.git



More information about the Pkg-games-commits mailing list