aboutsummaryrefslogtreecommitdiffstats
path: root/src/redo-ifchange.c
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2014-11-11 13:45:14 +0100
committerTharre <tharre3@gmail.com>2014-11-11 14:03:32 +0100
commit56f3fa373a76842275b199c9ce14fd8e626bd909 (patch)
tree3ef552a3041afe97686532a8bec492e2c786505d /src/redo-ifchange.c
parenta07239b0d220fb04dadd6422fd75defa13ee50b9 (diff)
downloadredo-56f3fa373a76842275b199c9ce14fd8e626bd909.tar.gz
redo-56f3fa373a76842275b199c9ce14fd8e626bd909.tar.xz
redo-56f3fa373a76842275b199c9ce14fd8e626bd909.zip
Some refactoring and small fixes.
Diffstat (limited to 'src/redo-ifchange.c')
-rw-r--r--src/redo-ifchange.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/redo-ifchange.c b/src/redo-ifchange.c
index e95e92e..75bd984 100644
--- a/src/redo-ifchange.c
+++ b/src/redo-ifchange.c
@@ -13,6 +13,12 @@
#include "dbg.h"
int main(int argc, char *argv[]) {
+ if (!environment_sane()) {
+ fprintf(stderr, "redo: environment variables are missing, \
+ please use %s only in do scripts.\n", argv[0]);
+ exit(1);
+ }
+
for (int i = 1; i < argc; ++i) {
/*debug("Testing if %s is up-to-date ...\n", argv[i]);*/
if (has_changed(argv[i], 'c', false)) {
@@ -23,4 +29,6 @@ int main(int argc, char *argv[]) {
}
add_dep(argv[i], NULL, 'c');
}
+
+ return 0;
}