Mercurial > urweb
diff src/c/urweb.c @ 1483:ebc30bb262d0
For non-debug builds, leave out source location info in what is shown to user
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sun, 03 Jul 2011 12:40:00 -0400 |
parents | 3d0cc841cafd |
children | 4300592e6803 |
line wrap: on
line diff
--- a/src/c/urweb.c Tue Jun 28 08:07:20 2011 -0400 +++ b/src/c/urweb.c Sun Jul 03 12:40:00 2011 -0400 @@ -3894,3 +3894,13 @@ 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); +}