From 8046a06297d7d2b9beb62a9c50d33fc4e31a6ce0 Mon Sep 17 00:00:00 2001 From: Dustin Mitchell Date: Fri, 21 Jan 2000 22:37:34 +0000 Subject: [PATCH] Changed strings to recognized backslashified quotes git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@140 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/DOH/Doh/string.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/DOH/Doh/string.c b/Source/DOH/Doh/string.c index e7bf9b344..8de999bbc 100644 --- a/Source/DOH/Doh/string.c +++ b/Source/DOH/Doh/string.c @@ -629,10 +629,10 @@ int String_ungetc(DOH *so, int ch) { * * Replaces token with rep. flags is as follows: * - * REPLACE_ANY - Replace all occurrences - * REPLACE_NOQUOTE - Don't replace in quotes - * REPLACE_ID - Only replace valid identifiers - * REPLACE_FIRST - Only replace first occurrence + * DOH_REPLACE_ANY - Replace all occurrences + * DOH_REPLACE_NOQUOTE - Don't replace in quotes + * DOH_REPLACE_ID - Only replace valid identifiers + * DOH_REPLACE_FIRST - Only replace first occurrence * * start is a starting position. count is a count. * ----------------------------------------------------------------------------- */ @@ -702,6 +702,9 @@ int replace_internal(String *str, char *token, char *rep, int flags, char *start } else if (flags & DOH_REPLACE_NOQUOTE) { if (*c == '\"') state = 20; else if (*c == '\'') state = 30; + else if (*c == '\\' && + (*(c+1) == '\'' || *(c+1) == '\"')) + c++; } break; case 10: /* The start of an identifier */