aboutsummaryrefslogtreecommitdiff
path: root/listamsb.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-03-08 22:39:42 -0500
committerB. Watson <urchlay@slackware.uk>2025-03-08 22:39:42 -0500
commitfd1128f0742913f0f6e9a5da47ab0d23e7cf95f3 (patch)
tree4d312c6e880dc0b13c39cd809f0edb02e39bdf33 /listamsb.c
parent1a45a059148e15e540312b2b6bd527245e809cc4 (diff)
downloadbw-atari8-tools-fd1128f0742913f0f6e9a5da47ab0d23e7cf95f3.tar.gz
listamsb: allow overriding a8cat path in environment.
Diffstat (limited to 'listamsb.c')
-rw-r--r--listamsb.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/listamsb.c b/listamsb.c
index 7195443..7d9ca81 100644
--- a/listamsb.c
+++ b/listamsb.c
@@ -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