switch_stream_handle_t stream = { 0 };
SWITCH_STANDARD_STREAM(stream);
- stream.write_function(&stream, " argv = {[0]='%s', ", input_code);
+ stream.write_function(&stream, " argv = {[0]='%y', ", input_code);
for (x = 0; x < argc; x++) {
- stream.write_function(&stream, "'%s'%s", argv[x], x == argc - 1 ? "" : ", ");
+ stream.write_function(&stream, "'%y'%s", argv[x], x == argc - 1 ? "" : ", ");
}
stream.write_function(&stream, " };");
code = (char *) stream.data;
#endif
#define etPOINTER 15 /* The %p conversion */
#define etSQLESCAPE3 16
+#define etSQLESCAPE4 17
/*
** An "etByte" is an 8-bit unsigned value.
{'q', 0, 4, etSQLESCAPE, 0, 0},
{'Q', 0, 4, etSQLESCAPE2, 0, 0},
{'w', 0, 4, etSQLESCAPE3, 0, 0},
+ {'y', 0, 4, etSQLESCAPE4, 0, 0},
{'c', 0, 0, etCHARX, 0, 0},
{'o', 8, 0, etRADIX, 0, 2},
{'u', 10, 0, etRADIX, 0, 0},
break;
case etSQLESCAPE:
case etSQLESCAPE2:
+ case etSQLESCAPE4:
case etSQLESCAPE3:{
int i, j, n, ch, isnull;
int needQuote;
bufpt = buf;
}
j = 0;
- if (needQuote)
+ if (needQuote)
bufpt[j++] = '\'';
for (i = 0; (ch = escarg[i]) != 0; i++) {
bufpt[j++] = (char) ch;
- if (ch == '\'' || (xtype == etSQLESCAPE3 && ch == '\\'))
- bufpt[j++] = (char) ch;
+ if (xtype == etSQLESCAPE4) {
+ if (ch == '\'' || (xtype == etSQLESCAPE3 && ch == '\\')) {
+ bufpt[j] = (char) ch;
+ bufpt[j-1] = (char) '\\';
+ j++;
+ }
+ } else {
+ if (ch == '\'' || (xtype == etSQLESCAPE3 && ch == '\\'))
+ bufpt[j++] = (char) ch;
+ }
}
if (needQuote)
bufpt[j++] = '\'';
}
}
/* strip quotes, escaped chars and leading / trailing spaces */
- if (count > 1) {
- for (i = 0; i < count; ++i) {
- array[i] = cleanup_separated_string(array[i], delim);
- }
+
+ for (i = 0; i < count; ++i) {
+ array[i] = cleanup_separated_string(array[i], delim);
}
+
return count;
}
}
}
/* strip quotes, escaped chars and leading / trailing spaces */
- if (count > 1) {
- for (i = 0; i < count; ++i) {
- array[i] = cleanup_separated_string(array[i], 0);
- }
+
+ for (i = 0; i < count; ++i) {
+ array[i] = cleanup_separated_string(array[i], 0);
}
+
return count;
}