summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2012-12-10 12:32:40 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2012-12-10 12:32:40 +0000
commit91d1d5325b6cf10a4cac8be6894d2dd548395ca4 (patch)
treeeaba7ce9b64423ea85de6d599c94df668c17b069 /Build
parent21193f790612abde8be2f375ed4533334113e2bf (diff)
remove look_for_cmd() from win32lib.c.
git-svn-id: svn://tug.org/texlive/trunk@28489 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog4
-rw-r--r--Build/source/texk/kpathsea/win32lib.c95
2 files changed, 4 insertions, 95 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 6df22070d30..7da5de83abc 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,7 @@
+2012-12-10 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * win32lib.c: remove look_for_cmd().
+
2012-12-08 Peter Breitenlohner <peb@mppmu.mpg.de>
* mingw32.c (look_for_cmd): Do not compute unused value.
diff --git a/Build/source/texk/kpathsea/win32lib.c b/Build/source/texk/kpathsea/win32lib.c
index 9573346bc74..5741c953e81 100644
--- a/Build/source/texk/kpathsea/win32lib.c
+++ b/Build/source/texk/kpathsea/win32lib.c
@@ -571,101 +571,6 @@ kpathsea_init_user_info (kpathsea kpse)
strcpy (kpse->the_passwd.pw_shell, getenv ("SHELL"));
}
-/* lookcmd */
-
-BOOL
-look_for_cmd(const char *cmd, char **app, char **new)
-{
- char *env_path;
- char *p, *q;
- char pname[MAXPATHLEN], *fp;
- char *suffixes[] = { ".bat", ".cmd", ".com", ".exe", NULL };
- char **s;
- char *app_name, *new_cmd;
-
- BOOL go_on;
-
- *new = *app = NULL;
- new_cmd = 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.
- Do nothing for the moment. */
-
- /* Another way to do that would be to try CreateProcess first without
- invoking cmd, and look at the error code. If it fails because of
- command not found, try to prepend "cmd /c" to the cmd line.
- */
-
- /* Look for the application name */
- for (p = (char *)cmd; *p && isspace(*p); p++);
- if (*p == '"') {
- q = ++p;
- while(*p && *p != '"') p++;
- if (*p == '\0') {
- fprintf(stderr, "Look_for_cmd: malformed command (\" not terminated)\n");
- return FALSE;
- }
- }
- else
- for (q = p; *p && !isspace(*p); p++);
- /* q points to the beginning of appname, p to the last + 1 char */
- if ((app_name = malloc(p - q + 1)) == NULL) {
- fprintf(stderr, "Look_for_cmd: malloc(app_name) failed.\n");
- return FALSE;
- }
- strncpy(app_name, q, p - q );
- app_name[p - q] = '\0';
- pname[0] = '\0';
-#ifdef TRACE
- fprintf(stderr, "popen: app_name = %s\n", app_name);
-#endif
-
- {
- char *tmp = getenv("PATH");
- env_path = xmalloc(strlen(tmp) + 3);
- strcpy(env_path, tmp);
- strcat(env_path, ";.");
- }
-
- /* Looking for appname on the path */
- for (s = suffixes, go_on = TRUE; go_on; s++) {
- if (SearchPath(env_path, /* Address of search path */
- app_name, /* Address of filename */
- *s, /* Address of extension */
- MAXPATHLEN, /* Size of destination buffer */
- pname, /* Address of destination buffer */
- &fp) /* File part of app_name */
- != 0 && *s) { /* added *s in order not to allow no suffix.
- --ak 2009/07/08 */
-#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;
- }
- go_on = (*s != NULL);
- }
- if (go_on == FALSE) {
- /* the app_name was not found */
-#ifdef TRACE
- fprintf(stderr, "%s not found, concatenating comspec\n", app_name);
-#endif
- new_cmd = concatn("cmd.exe", " /c ", cmd, NULL);
- free(app_name);
- app_name = NULL;
- }
- if (env_path) free(env_path);
-
- *new = new_cmd;
- *app = app_name;
-
- return TRUE;
-
-}
-
/*
Command parser. Borrowed from DJGPP.
*/