diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-04-23 06:28:48 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-04-23 14:12:35 +0300 |
commit | c1ef6f543d6c1d7163fd07015b1e8807ca1458ae (patch) | |
tree | f84d384149e31efb01b891dcc8b8b68eab0006a1 | |
parent | 0d63b366a09ddfdc27009dcf8d3dff83aba0cdd3 (diff) | |
download | videoteco-fork-c1ef6f543d6c1d7163fd07015b1e8807ca1458ae.tar.gz |
DOS: the ini file is called TECO.INI and is located in the binary's directory
You can also `set VTECO=...` to the directory of TECO.INI (usually the installation directory).
This is helpful if the location of the binary's directory is unreliable.
-rw-r--r-- | teco.c | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -110,7 +110,7 @@ char *copyright = "Copyright (c) 1985-2007 Paul Cantrell"; * Prototypes */ void init_signals(void); - void teco_ini(void); + void teco_ini(const char *); void process_directory(char *,char*,int); int match_name(char *,char *); int map_baud(int); @@ -161,7 +161,7 @@ register int i; handle_command_line(1,argc,argv); - teco_ini(); + teco_ini(argv[0]); teco_startup = NO; @@ -848,7 +848,7 @@ int cmd_winch(void); * Q-Register contents he has specified. It also executes Q-Register 0. */ void -teco_ini() +teco_ini(const char *prg) { register char *cp; register int c,dc; @@ -877,12 +877,24 @@ char comment_flag = NO; #ifdef MSDOS /* - * FIXME: We should use the location - * of teco.exe. + * Locate TECO.INI in the same directory + * as the executable. + * This approach may fail in some command interpreters, + * so you may have to point the VTECO environment + * variable to the directory with TECO.INI instead. */ - (void) strcat(filename,".teco_ini"); + if((cp = getenv("VTECO"))){ + strcpy(filename,cp); + }/* End If */ + else if((cp = strrchr(prg,'\\'))){ + strncpy(filename,prg,cp-prg); + filename[cp-prg] = '\0'; + }/* End If */ + else return; -#endif + strcat(filename,"\\TECO.INI"); + +#endif /* MSDOS */ #ifdef VMS |