# HG changeset patch # User Adam Chlipala # Date 1381444270 14400 # Node ID 0354df1b684955ec83742edccaad522343bdddbb # Parent c1ee5dec9cff653a5b9babaa66e3d4aa7e5d97a1 Remove uw_cutErrorLocation() hijinks diff -r c1ee5dec9cff -r 0354df1b6849 include/urweb/urweb.h --- a/include/urweb/urweb.h Thu Oct 10 18:04:29 2013 -0400 +++ b/include/urweb/urweb.h Thu Oct 10 18:31:10 2013 -0400 @@ -351,8 +351,6 @@ uw_Basis_bool uw_Basis_currentUrlHasPost(uw_context); uw_Basis_bool uw_Basis_currentUrlHasQueryString(uw_context); -void uw_cutErrorLocation(char *); - uw_Basis_string uw_Basis_fresh(uw_context); uw_Basis_float uw_Basis_floatFromInt(uw_context, uw_Basis_int); diff -r c1ee5dec9cff -r 0354df1b6849 src/c/urweb.c --- a/src/c/urweb.c Thu Oct 10 18:04:29 2013 -0400 +++ b/src/c/urweb.c Thu Oct 10 18:31:10 2013 -0400 @@ -4103,16 +4103,6 @@ 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); -} - uw_Basis_string uw_Basis_fresh(uw_context ctx) { int len; char *r; diff -r c1ee5dec9cff -r 0354df1b6849 src/cjr_print.sml --- a/src/cjr_print.sml Thu Oct 10 18:04:29 2013 -0400 +++ b/src/cjr_print.sml Thu Oct 10 18:31:10 2013 -0400 @@ -1617,8 +1617,11 @@ string "tmp;", newline, string "uw_error(ctx, FATAL, \"", - string (ErrorMsg.spanToString loc), - string ": %s\", ", + string (if Settings.getDebug () then + ErrorMsg.spanToString loc ^ ": " + else + ""), + string "%s\", ", p_exp' false false env e, string ");", newline, @@ -3515,11 +3518,6 @@ NONE => box [] | SOME n => box [string "static void uw_onError(uw_context ctx, char *msg) {", newline, - if Settings.getDebug () then - box [] - else - box [string "uw_cutErrorLocation(msg);", - newline], if !hasJs then box [string "uw_set_script_header(ctx, \"", string allScripts,