* Escape strings so that SQLite is happy
*
* NOTE! len is the length of the old string. Your new
- * string must be long enough (max 2*old) to hold
+ * string must be long enough (max 2*old+1) to hold
* the escaped output.
*/
void
* list on one line horizontally.
*/
void
-list_result(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, int full_list)
+list_result(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, e_list_type type)
{
SQL_FIELD *field;
SQL_ROW row;
for (i = 0; i < sql_num_fields(mdb); i++) {
field = sql_fetch_field(mdb);
col_len = strlen(field->name);
- if (full_list) {
+ if (type == VERT_LIST) {
if (col_len > max_len) {
max_len = col_len;
}
}
}
- if (full_list) {
- goto horizontal_list;
+ if (type == VERT_LIST) {
+ goto vertical_list;
}
list_dashes(mdb, send, ctx);
list_dashes(mdb, send, ctx);
return;
-horizontal_list:
+vertical_list:
while ((row = sql_fetch_row(mdb)) != NULL) {
sql_field_seek(mdb, 0);