diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-02-08 09:23:49 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-02-08 09:23:49 +0000 |
commit | 3a3852f142d4db474cff63d9e02ed4af85e9cbce (patch) | |
tree | ef187cc302105d6c198651c2bcb29a6bcdef2273 | |
parent | afadeafcb2f6981fbf18c94b93354bd5d9e1afb4 (diff) |
mingw32.c more cleanup
git-svn-id: svn://tug.org/texlive/trunk@16943 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/mingw32.c | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 821f142df8f..28f229ad0a3 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,8 @@ +2010-02-08 Peter Breitenlohner <peb@mppmu.mpg.de> + + * mingw32.c (look_for_cmd): remove unused variable new_cmd, + declare p and q as const and remove cast. + 2010-02-07 Taco Hoekwater <taco@elvenkind.com> * mingw32.c (look_for_cmd): remove unused variable new, diff --git a/Build/source/texk/kpathsea/mingw32.c b/Build/source/texk/kpathsea/mingw32.c index 1180c46de62..9523383e2ec 100644 --- a/Build/source/texk/kpathsea/mingw32.c +++ b/Build/source/texk/kpathsea/mingw32.c @@ -403,16 +403,16 @@ BOOL look_for_cmd(const char *cmd, char **app) { char *env_path; - char *p, *q; + const char *p, *q; char pname[MAXPATHLEN], *fp; char *suffixes[] = { ".bat", ".cmd", ".com", ".exe", NULL }; char **s; - char *app_name, *new_cmd; + char *app_name; BOOL go_on; *app = NULL; - new_cmd = app_name = NULL; + app_name = NULL; /* We should look for the application name along the PATH, and decide to prepend "%COMSPEC% /c " or not to the command line. @@ -424,7 +424,7 @@ look_for_cmd(const char *cmd, char **app) */ /* Look for the application name */ - for (p = (char *)cmd; *p && isspace(*p); p++); + for (p = cmd; *p && isspace(*p); p++); if (*p == '"') { q = ++p; while(*p && *p != '"') p++; @@ -466,7 +466,6 @@ look_for_cmd(const char *cmd, char **app) #ifdef TRACE fprintf(stderr, "%s found with suffix %s\nin %s\n", app_name, *s, pname); #endif - new_cmd = xstrdup(cmd); free(app_name); app_name = xstrdup(pname); break; @@ -478,12 +477,9 @@ look_for_cmd(const char *cmd, char **app) #ifdef TRACE fprintf(stderr, "%s not found, concatenating comspec\n", app_name); #endif - new_cmd = concatn(getenv("COMSPEC"), " /c ", cmd, NULL); free(app_name); app_name = NULL; } - else { - } if (env_path) free(env_path); *app = app_name; |