*** ecpglib.c.orig Wed Dec 22 15:52:19 1999 --- ecpglib.c Wed Dec 22 15:51:45 1999 *************** *** 228,235 **** --- 228,238 ---- switch (arg[i]) { case '\'': + res[ri++] = '\''; + break; case '\\': res[ri++] = '\\'; + break; default: ; } *************** *** 365,371 **** bool string = false; for (; *ptr != '\0' && (*ptr != '?' || string); ptr++) ! if (*ptr == '\'') string = string ? false : true; return (*ptr == '\0') ? NULL : ptr; --- 368,374 ---- bool string = false; for (; *ptr != '\0' && (*ptr != '?' || string); ptr++) ! if (*ptr == '\'' && *(ptr-1) != '\\') string = string ? false : true; return (*ptr == '\0') ? NULL : ptr; *************** *** 379,384 **** --- 382,388 ---- PGresult *results; PGnotify *notify; struct variable *var; + int hostvarl = 0; memcpy((char *) &sqlca, (char *) &sqlca_init, sizeof(sqlca)); *************** *** 569,575 **** return false; strcpy(newcopy, copiedquery); ! if ((p = next_insert(newcopy)) == NULL) { /* --- 573,579 ---- return false; strcpy(newcopy, copiedquery); ! if ((p = next_insert(newcopy+hostvarl)) == NULL) { /* *************** *** 582,587 **** --- 586,592 ---- else { strcpy(p, tobeinserted); + hostvarl = strlen(newcopy); /* * The strange thing in the second argument is the rest of the *************** *** 1227,1232 **** --- 1232,1238 ---- { struct connection *con; + memcpy((char *) &sqlca, (char *) &sqlca_init, sizeof(sqlca)); if (strcmp(connection_name, "ALL") == 0) { for (con = all_connections; con;)