File tree 2 files changed +15
-7
lines changed
2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright 2000 by PostgreSQL Global Development Group
5
5
*
6
- * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.29 2000/05/11 18:41:00 momjian Exp $
6
+ * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.30 2000/05/12 16:13:44 petere Exp $
7
7
*/
8
8
#include "postgres.h"
9
9
#include "help.h"
@@ -269,11 +269,11 @@ helpSQL(const char *topic)
269
269
270
270
for (i = 0 ; i < items_per_column ; i ++ )
271
271
{
272
- printf (" %-25s%-25s " ,
272
+ printf (" %-26s%-26s " ,
273
273
VALUE_OR_NULL (QL_HELP [i ].cmd ),
274
274
VALUE_OR_NULL (QL_HELP [i + items_per_column ].cmd ));
275
275
if (i + 2 * items_per_column < QL_HELP_COUNT )
276
- printf ("%-25s " ,
276
+ printf ("%-26s " ,
277
277
VALUE_OR_NULL (QL_HELP [i + 2 * items_per_column ].cmd ));
278
278
fputc ('\n' , stdout );
279
279
}
@@ -283,10 +283,16 @@ helpSQL(const char *topic)
283
283
{
284
284
int i ;
285
285
bool help_found = false;
286
+ size_t len ;
287
+
288
+ /* don't care about trailing spaces */
289
+ len = strlen (topic );
290
+ while (topic [len - 1 ] == ' ' )
291
+ len -- ;
286
292
287
293
for (i = 0 ; QL_HELP [i ].cmd ; i ++ )
288
294
{
289
- if (strcasecmp ( QL_HELP [i ].cmd , topic ) == 0 ||
295
+ if (strncasecmp ( topic , QL_HELP [i ].cmd , len ) == 0 ||
290
296
strcmp (topic , "*" ) == 0 )
291
297
{
292
298
help_found = true;
@@ -298,7 +304,7 @@ helpSQL(const char *topic)
298
304
}
299
305
300
306
if (!help_found )
301
- printf ("No help available for '%s'.\nTry \\h with no arguments to see available help.\n" , topic );
307
+ printf ("No help available for '%-.* s'.\nTry \\h with no arguments to see available help.\n" , ( int ) len , topic );
302
308
}
303
309
}
304
310
Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright 2000 by PostgreSQL Global Development Group
5
5
*
6
- * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.29 2000/04/14 23:43 :44 petere Exp $
6
+ * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.30 2000/05/12 16:13 :44 petere Exp $
7
7
*/
8
8
#include "postgres.h"
9
9
#include "mainloop.h"
@@ -297,6 +297,7 @@ MainLoop(FILE *source)
297
297
else
298
298
bslash_count = 0 ;
299
299
300
+ rescan :
300
301
/* in quote? */
301
302
if (in_quote )
302
303
{
@@ -382,7 +383,8 @@ MainLoop(FILE *source)
382
383
free (line );
383
384
line = new ;
384
385
len = strlen (new );
385
- continue ; /* reparse the just substituted */
386
+
387
+ goto rescan ; /* reparse the just substituted */
386
388
}
387
389
else
388
390
{
You can’t perform that action at this time.
0 commit comments