about summary refs log tree commit diff
path: root/nix-repl.cc
diff options
context:
space:
mode:
authorScott Olson <scott@solson.me>2016-02-14T07·29-0600
committerScott Olson <scott@solson.me>2016-02-14T07·29-0600
commit2111098a3a26d11edf4452f021245b55287c45b8 (patch)
treed08aa0e1fd221dffd937b64fbc4e5cad0cece081 /nix-repl.cc
parentf7980b471273d695aa0b28f2f73e6ee443dfe9eb (diff)
Don't consider strings starting with - or ' as variable names.
Diffstat (limited to 'nix-repl.cc')
-rw-r--r--nix-repl.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/nix-repl.cc b/nix-repl.cc
index 25f84a3082ab..5c319f068655 100644
--- a/nix-repl.cc
+++ b/nix-repl.cc
@@ -250,7 +250,8 @@ static int runProgram(const string & program, const Strings & args)
 
 bool isVarName(const string & s)
 {
-    // FIXME: not quite correct.
+    if (s.size() > 0 && (s[0] == '-' || s[0] == '\''))
+        return false;
     for (auto & i : s)
         if (!((i >= 'a' && i <= 'z') ||
               (i >= 'A' && i <= 'Z') ||