diff options
-rw-r--r-- | parser.c | 2 | ||||
-rw-r--r-- | txr.1 | 10 | ||||
-rw-r--r-- | txr.c | 5 | ||||
-rw-r--r-- | txr.h | 1 |
4 files changed, 16 insertions, 2 deletions
@@ -1470,7 +1470,7 @@ val repl(val bindings, val in_stream, val out_stream, val env) val home = if3(repl_level == 1, get_home_path(), nil); val histfile = if2(home, scat2(home, lit("/.txr_history"))); const wchar_t *histfile_w = if3(home, c_str(histfile), NULL); - val rcfile = if2(home, scat2(home, lit("/.txr_profile"))); + val rcfile = if2(home && !opt_noprofile, scat2(home, lit("/.txr_profile"))); val old_sig_handler = set_sig_handler(num(SIGINT), func_n2(repl_intr)); val hist_len_var = lookup_global_var(listener_hist_len_s); val multi_line_var = lookup_global_var(listener_multi_line_p_s); @@ -982,6 +982,12 @@ The re-executed image will then obtain the script name from the arguments which are passed to it and determine whether that script will run setuid. See the section SETUID/SETGID OPERATION. +.coIP --noprofile +If entering the interactive listener, suppress the reading of the +.code .txr_profile +in the home directory. See the Interactive Profile File subsection in the +INTERACTIVE LISTENER section of the manual. + .coIP --gc-debug This option enables a behavior which stresses the garbage collector with frequent garbage collection requests. The purpose is to make it more likely @@ -81246,7 +81252,9 @@ is still processed, as usual. .SS* Interactive Profile File -When the listener starts up, it looks for file called +Unless the +.code --noprofile +option has been used, when the listener starts up, it looks for file called .code .txr_profile in the user's home directory, as determined by the .code HOME @@ -66,6 +66,7 @@ wchar_t *progname; static const char *progname_u8; static val prog_path = nil, sysroot_path = nil; int opt_noninteractive; +int opt_noprofile; int opt_compat; int opt_dbg_expansion; val stdlib_path; @@ -156,6 +157,7 @@ static void help(void) " the following argument arg, and allows one or more\n" " copies of it to be to be embedded in the\n" " encoded arguments. See manual.\n" +"--noprofile Do not read .txr_profile when entering listener.\n" #if HAVE_FORK_STUFF "--reexec Re-execute TXR with remaining arguments.\n" #endif @@ -799,6 +801,9 @@ int txr_main(int argc, char **argv) } else if (equal(opt, lit("free-all"))) { atexit(free_all); continue; + } else if (equal(opt, lit("noprofile"))) { + opt_noprofile = 1; + continue; } else { drop_privilege(); format(std_error, lit("~a: unrecognized long option: --~a\n"), @@ -39,6 +39,7 @@ extern int opt_compat; extern int opt_debugger; extern int opt_dbg_autoload; extern int opt_dbg_expansion; +extern int opt_noprofile; extern alloc_bytes_t opt_gc_delta; extern const wchli_t *version; extern wchar_t *progname; |