[gimp] app: interpreter arguments for plugins not returned.



commit da4247d87c78d80b83f60fb6d89c8650bee36f3d
Author: Jehan <jehan girinstud io>
Date:   Tue Aug 19 15:04:30 2014 +0200

    app: interpreter arguments for plugins not returned.
    
    When a plugin file's shebang would start with "/usr/bin/env", the
    interpreter's arguments were not returned by resolve_sh_bang().

 app/plug-in/gimpinterpreterdb.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/app/plug-in/gimpinterpreterdb.c b/app/plug-in/gimpinterpreterdb.c
index 28d0e05..6858244 100644
--- a/app/plug-in/gimpinterpreterdb.c
+++ b/app/plug-in/gimpinterpreterdb.c
@@ -692,12 +692,18 @@ resolve_sh_bang (GimpInterpreterDB  *db,
     {
       if (strcmp ("/usr/bin/env", name) == 0)
         {
-          program = g_hash_table_lookup (db->programs, cp);
-          if (program)
-            return g_strdup (program);
+          /* Shift program name and arguments to the right. */
+          name = cp;
+
+          for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++)
+            ;
+
+          while ((*cp == ' ') || (*cp == '\t'))
+            *cp++ = '\0';
         }
 
-      *interp_arg = g_strdup (cp);
+      if (*cp)
+        *interp_arg = g_strdup (cp);
     }
 
   program = g_hash_table_lookup (db->programs, name);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]