about summary refs log tree commit diff
path: root/patch.c
diff options
context:
space:
mode:
Diffstat (limited to 'patch.c')
-rw-r--r--patch.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/patch.c b/patch.c
index eacf2b1..027142b 100644
--- a/patch.c
+++ b/patch.c
@@ -20,32 +20,32 @@
 
 #include "stdlib.c"
 
-const char *taosc_predicate;
-const void *taosc_destination;
+static const void *destination;
+static const char *predicate;
 
 /*
  * Get an environment variable and parse as a number.
  * Return 0 on error.
  */
-uint64_t getenvull(const char *name)
+static uint64_t getenvull(const char *name)
 {
-	const char *const s = getenv(name);
-	if (s == NULL)
+	const char *const str = getenv(name);
+	if (str == NULL)
 		return 0ULL;
 	errno = 0;
-	const uint64_t u = strtoull(s, NULL, 0);
+	const uint64_t ull = strtoull(str, NULL, 0);
 	if (errno)
 		return 0ULL;
-	return u;
+	return ull;
 }
 
 void init(int argc, const char *const *argv, char **envp)
 {
 	environ = envp;
-	taosc_predicate = getenv("TAOSC_PREDICATE");
-	if (taosc_predicate == NULL)
-		taosc_predicate = "p0"; /* false */
-	taosc_destination = (void *) getenvull("TAOSC_DESTINATION");
+	destination = (void *) getenvull("TAOSC_DEST");
+	predicate = getenv("TAOSC_PRED");
+	if (predicate == NULL)
+		predicate = "p0"; /* false */
 }
 
 /* Parse *p as an integer. */
@@ -97,6 +97,6 @@ int64_t eval(const char **ptr, const int64_t *env)
 
 const void *dest(const struct STATE *state)
 {
-	const char *tmp = taosc_predicate;
-	return eval(&tmp, (const int64_t *) state) ? NULL : taosc_destination;
+	const char *tmp = predicate;
+	return eval(&tmp, (const int64_t *) state) ? NULL : destination;
 }