aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-02-11 22:00:03 +0100
committerMattias Andrée <maandree@kth.se>2024-02-11 22:00:03 +0100
commit7321030f3e0b5041d719405d38d3572946e57add (patch)
treef7ee0b9c8a4aa5c32cef6f4940c944e27d28f3e3
parentFix bugs, and some cleanup (diff)
downloadmakeenv-7321030f3e0b5041d719405d38d3572946e57add.tar.gz
makeenv-7321030f3e0b5041d719405d38d3572946e57add.tar.bz2
makeenv-7321030f3e0b5041d719405d38d3572946e57add.tar.xz
Fail if .makeenv has a line that starts with =
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--makeenv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/makeenv.c b/makeenv.c
index f71bc00..2f88f2d 100644
--- a/makeenv.c
+++ b/makeenv.c
@@ -317,8 +317,12 @@ main(int argc, char *argv[])
put_options(line);
} else if (has_equals) {
trim_around_equals(line);
- if (*line != '=' && *line != '#')
+ if (*line == '=') {
+ fprintf(stderr, "%s: empty variable name listed in .makeenv\n", argv0);
+ return 125;
+ } else if (*line != '#') {
put_macro(line);
+ }
} else {
if (*line && *line != '#')
put_targets(line);