comparison src/c/urweb.c @ 874:3c7b48040dcf

MySQL demo/sql succeeds in reading no rows
author Adam Chlipala <adamc@hcoop.net>
date Sun, 12 Jul 2009 15:05:40 -0400
parents 03e7f111fe99
children b2a175a0f2ef
comparison
equal deleted inserted replaced
873:41971801b62d 874:3c7b48040dcf
2740 2740
2741 ctx->cleanup_front = ctx->cleanup; 2741 ctx->cleanup_front = ctx->cleanup;
2742 2742
2743 longjmp(ctx->jmp_buf, RETURN_BLOB); 2743 longjmp(ctx->jmp_buf, RETURN_BLOB);
2744 } 2744 }
2745
2746 uw_Basis_string uw_Basis_unAs(uw_context ctx, uw_Basis_string s) {
2747 uw_Basis_string r = uw_malloc(ctx, strlen(s) + 1);
2748
2749 for (; *s; ++s) {
2750 if (s[0] == '\'') {
2751 *r++ = '\'';
2752 for (++s; *s; ++s) {
2753 if (s[0] == '\'') {
2754 *r++ = '\'';
2755 break;
2756 } else if (s[0] == '\\') {
2757 if (s[1] == '\\') {
2758 *r++ = '\\';
2759 *r++ = '\\';
2760 ++s;
2761 } else if (s[1] == '\'') {
2762 *r++ = '\\';
2763 *r++ = '\'';
2764 ++s;
2765 } else
2766 *r++ = '\'';
2767 } else
2768 *r++ = s[0];
2769 }
2770 if (*s == 0) break;
2771 } else if (s[0] == 'T' && s[1] == '.')
2772 ++s;
2773 else
2774 *r++ = s[0];
2775 }
2776
2777 return r;
2778 }
2779