fixed *nix build
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 28 Jan 2007 19:28:55 +0000 (19:28 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 28 Jan 2007 19:28:55 +0000 (19:28 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4605 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCmain.c
src/SDCCutil.c
support/Util/MySystem.c

index e6c867f804fde3906a10072f31901d5854ed04b5..073e4608bcaa6b2b11a9d1b4b66195d64d7847ed 100644 (file)
@@ -630,7 +630,7 @@ processFile (char *s)
   extp = dbuf_c_str (&ext);
   if (extp[1] == '\0' && (extp[0] == 'c' || extp[0] == 'C'))
     {
-      unsigned char *p;
+      char *p;
 
       dbuf_destroy (&ext);
 
@@ -667,7 +667,7 @@ processFile (char *s)
       moduleName = dbuf_detach (&ext);
 
       for (p = moduleName; *p; ++p)
-        if (!isalnum(*p))
+        if (!isalnum ((unsigned char)*p))
           *p = '_';
       return;
     }
index b5ce4b302c5c097d0dee0d07ca17c27651f63a43..6673b36378047a3c9882d90c65da99ce795358c1 100644 (file)
@@ -244,7 +244,8 @@ getBinPath(const char *prel)
           dbuf_init(&path, 128);
 
           dbuf_splitPath(module, &path, NULL);
-          return dbuf_c_str(&path);
+          dbuf_c_str(&path);
+          return dbuf_detach(&path);
         }
       else
         return NULL;
@@ -254,16 +255,18 @@ getBinPath(const char *prel)
 const char *
 getBinPath(const char *prel)
 {
-  struct dbuf_s path;
   const char *ret_path;
 
   if (NULL != (ret_path = findProgramPath(prel)))
     {
-      dbuf_splitPath(prel, path, NULL);
+      struct dbuf_s path;
 
-      free((void *)ret_path);
+      dbuf_init(&path, 128);
 
-      return dbuf_c_str(path);
+      dbuf_splitPath(ret_path, &path, NULL);
+      free((void *)ret_path);
+      dbuf_c_str(&path);
+      return dbuf_detach(&path);
     }
   else
     return NULL;
index 30e657c571e9757900a1e807947563c691ba8049..089b6b55d6095c7ef50f311898778798560e93a2 100644 (file)
@@ -249,7 +249,7 @@ merge_command(const char *command, const char *params)
 static int
 has_path(const char *path)
 {
-  return splitPath(path, NULL, 0, NULL, 0);
+  return dbuf_splitPath(path, NULL, NULL);
 }