* src/pic16/glue.c, src/SDCC.y, src/SDCCast.c, src/SDCCglue.c,
[fw/sdcc] / support / Util / MySystem.c
index 7017ad1e02b4d3118c5df669c3bbc0f34725b744..6aec20f98e91b338e1592926bab4441e115cfcec 100644 (file)
@@ -237,23 +237,19 @@ merge_command(const char *command, const char *params)
 {
   /* allocate extra space for 2x'"', ' ' and '\0' */
   char *cmd_line = (char *)Safe_alloc(strlen(command) + strlen(params) + 4);
-  sprintf(cmd_line, "%s %s", command, params);
-
+  sprintf(cmd_line, "\"%s\" %s", command, params);
   return cmd_line;
 }
 
 
 /*!
- * check if the path is absolute
+ * check if the path is relative or absolute (if contains the dir separator)
  */
 
 static int
 has_path(const char *path)
 {
-  if (strrchr(path, DIR_SEPARATOR_CHAR) == NULL)
-      return 0;
-
-  return 1;
+  return dbuf_splitPath(path, NULL, NULL);
 }
 
 
@@ -325,6 +321,11 @@ my_system(const char *cmd)
   }
 
   e = system(cmdLine);
+
+  if (options.verboseExec && e) {
+      printf("+ %s returned errorcode %d\n", cmdLine, e);
+  }
+
   Safe_free(cmdLine);
 
   return e;