diff options
author | B. Watson <urchlay@slackware.uk> | 2025-03-08 22:39:42 -0500 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2025-03-08 22:39:42 -0500 |
commit | fd1128f0742913f0f6e9a5da47ab0d23e7cf95f3 (patch) | |
tree | 4d312c6e880dc0b13c39cd809f0edb02e39bdf33 /listamsb.c | |
parent | 1a45a059148e15e540312b2b6bd527245e809cc4 (diff) | |
download | bw-atari8-tools-fd1128f0742913f0f6e9a5da47ab0d23e7cf95f3.tar.gz |
listamsb: allow overriding a8cat path in environment.
Diffstat (limited to 'listamsb.c')
-rw-r--r-- | listamsb.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -751,9 +751,15 @@ void get_line_range(const char *arg) { } void parse_args(int argc, char **argv) { + const char *a8cat; char tmp[10]; int opt; + a8cat = getenv("A8CAT"); + if(!a8cat) a8cat = "a8cat"; + + strncpy(pipe_command, a8cat, BUFSIZ); + if(argc >= 2) { if(strcmp(argv[1], "--help") == 0) { print_help(); @@ -832,6 +838,12 @@ void open_output() { outfile = stdout; verbose(1, "using stdout for output"); } else { + const char *a8cat; + if((a8cat = getenv("A8CAT"))) { + verbose(1, "read A8CAT=%s from environment", a8cat); + } else { + verbose(1, "A8CAT not set in environment, using 'a8cat'"); + } verbose(1, "using pipe for output: %s", pipe_command); outfile = popen(pipe_command, "w"); /* "wb" not allowed! */ /* we probably never see this error. popen() fails only if |