count += str.count;
}
}
+ void cat(const char *str) {
+ if (count > 0) {
+ pm_strcat(list, ",");
+ }
+ pm_strcat(list, str);
+ count++;
+ }
private:
db_list_ctx(const db_list_ctx&); /* prohibit pass by value */
db_list_ctx &operator=(const db_list_ctx&); /* prohibit class assignment */
{
db_list_ctx *lctx = (db_list_ctx *)ctx;
if (num_fields == 1 && row[0]) {
- if (lctx->list[0]) {
- pm_strcat(lctx->list, ",");
- }
- pm_strcat(lctx->list, row[0]);
- lctx->count++;
+ lctx->cat(row[0]);
}
return 0;
}