From 85ddc5b6db228112aa6c048ea274dc34f0f184bf Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 9 Nov 2013 14:33:55 +0100 Subject: [PATCH] inpcom.c, remove variable "sourcefile" and references to "sourcefile" this will no longer be required for access to input file residing in the executable's directory --- src/frontend/inpcom.c | 28 ---------------------------- src/main.c | 2 -- 2 files changed, 30 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 5f6bd3637..db85182f8 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -973,7 +973,6 @@ is_plain_filename(const char *p) /*-------------------------------------------------------------------------* Look up the variable sourcepath and try everything in the list in order if the file isn't in . and it isn't an abs path name. - For MS Windows: First try the path of the source file. *-------------------------------------------------------------------------*/ FILE * @@ -983,33 +982,6 @@ inp_pathopen(char *name, char *mode) char buf[BSIZE_SP]; struct variable *v; -#if defined(HAS_WINGUI) - char buf2[BSIZE_SP]; - - /* search in the path where the source (input) file has been found, - but only if "name" is just a file name */ - if (!strchr(name, DIR_TERM) && !strchr(name, DIR_TERM_LINUX) && cp_getvar("sourcefile", CP_STRING, buf2)) { - /* If pathname is found, get path. - (char *dirname(const char *name) might have been used here) */ - if (substring(DIR_PATHSEP, buf2) || substring(DIR_PATHSEP_LINUX, buf2)) { - int i, j = 0; - for (i = 0; i < BSIZE_SP-1; i++) { - if (buf2[i] == '\0') - break; - if ((buf2[i] == DIR_TERM) || (buf2[i] == DIR_TERM_LINUX)) - j = i; - } - buf2[j+1] = '\0'; /* include path separator */ - } - /* add file name */ - strcat(buf2, name); - /* try to open file */ - if ((fp = fopen(buf2, mode)) != NULL) - return (fp); - } - -#endif - /* just try it */ if ((fp = fopen(name, mode)) != NULL) return fp; diff --git a/src/main.c b/src/main.c index f6294d8b4..7db4af0eb 100644 --- a/src/main.c +++ b/src/main.c @@ -1212,8 +1212,6 @@ main(int argc, char **argv) #if defined(HAS_WINGUI) /* write source file name into source window */ SetSource(dname); - /* write source file name into a variable */ - cp_vset("sourcefile", CP_STRING, dname); #endif append_to_stream(tempfile, tp);