From 8437eb549b544130a68d90e7099592f59330bcde Mon Sep 17 00:00:00 2001 From: borutr Date: Sun, 28 Jan 2007 19:28:55 +0000 Subject: [PATCH] fixed *nix build git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4605 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCmain.c | 4 ++-- src/SDCCutil.c | 13 ++++++++----- support/Util/MySystem.c | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/SDCCmain.c b/src/SDCCmain.c index e6c867f8..073e4608 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -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; } diff --git a/src/SDCCutil.c b/src/SDCCutil.c index b5ce4b30..6673b363 100644 --- a/src/SDCCutil.c +++ b/src/SDCCutil.c @@ -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; diff --git a/support/Util/MySystem.c b/support/Util/MySystem.c index 30e657c5..089b6b55 100644 --- a/support/Util/MySystem.c +++ b/support/Util/MySystem.c @@ -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); } -- 2.39.5