Changeset: 21c645046ec4 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=21c645046ec4 Modified Files: clients/mapiclient/mhelp.c Branch: Nov2019 Log Message:
Corrected issue that when \help is used it showed the SQL commands in 5 columns and when \help * is used it showed them in 3 columns. It appeared that when pattern is * it also added the number of entries from sqlhelp2[] but they were not printed in the loop further on. Only the entries from sqlhelp1[] are displayed, so only those need to be counted. diffs (25 lines): diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -1105,20 +1105,13 @@ sql_help(const char *pattern, stream *to } return; } + // collect the major topics for (i = 0; sqlhelp1[i].command; i++) { total++; if ((len = strlen(sqlhelp1[i].command)) > maxlen) maxlen = len; } - if (*pattern == '*') { - for (i = 0; sqlhelp2[i].command; i++) { - total++; - if ((len = strlen(sqlhelp2[i].command)) > maxlen) - maxlen = len; - } - } - // provide summary of all major topics (=search terms) ncolumns = (int) maxlen > pagewidth ? 1 : (int) (pagewidth / maxlen); if (ncolumns > 1 && ncolumns * (int) maxlen + ncolumns - 1 > pagewidth) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list