diff --git a/src/interfaces/ecpg/lib/ecpglib.c b/src/interfaces/ecpg/lib/ecpglib.c index aae621fed45..2b9a984c007 100644 --- a/src/interfaces/ecpg/lib/ecpglib.c +++ b/src/interfaces/ecpg/lib/ecpglib.c @@ -365,7 +365,7 @@ next_insert(char *text) bool string = false; for (; *ptr != '\0' && (*ptr != '?' || string); ptr++) - if (*ptr == '\'') + if (*ptr == '\'' && *(ptr-1) != '\\') string = string ? false : true; return (*ptr == '\0') ? NULL : ptr;