aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-02-09 12:41:54 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-02-09 12:41:54 +0000
commitd0eda1f3e9b2030e373038fd8997f033f2d7aedd (patch)
tree9db733f87fceaba36ddcba54b794b8be06c1d136 /src/libexpr/primops.cc
parent3854fc9b42d16b810f62b64194b699033b03aaf1 (diff)
parent543988572e2abc85767da315b2acc1f971c5d07f (diff)
* Merged the SQLite branch.
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index a4812de06..3e955ea3f 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -965,7 +965,7 @@ static void prim_substring(EvalState & state, Value * * args, Value & v)
if (start < 0) throw EvalError("negative start position in `substring'");
- mkString(v, string(s, start, len), context);
+ mkString(v, start >= s.size() ? "" : string(s, start, len), context);
}