summaryrefslogtreecommitdiff
path: root/src/c
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-07-03 12:40:00 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-07-03 12:40:00 -0400
commit3311911fd21e0c240788d83ff6da710dbbbc66e8 (patch)
tree57875f0e93a279eeaac3f66eac6372405cdf4b60 /src/c
parentdd592cc205438ef4a46f7103d0fc7113e376d358 (diff)
For non-debug builds, leave out source location info in what is shown to user
Diffstat (limited to 'src/c')
-rw-r--r--src/c/urweb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index b653390a..e38cd072 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -3894,3 +3894,13 @@ failure_kind uw_begin_onError(uw_context ctx, char *msg) {
void uw_mayReturnIndirectly(uw_context ctx) {
ctx->allowed_to_return_indirectly = 1;
}
+
+void uw_cutErrorLocation(char *s) {
+ char *s2;
+
+ s2 = strstr(s, ": ");
+ if (s2 == NULL || strcspn(s, "<&") < s2 - s)
+ return;
+
+ memmove(s, s2+2, strlen(s2+2)+1);
+}