Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9d31e3a

Browse files
committed
/home/peter/commit-msg
1 parent475cb15 commit9d31e3a

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

‎src/bin/psql/help.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
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 $
77
*/
88
#include"postgres.h"
99
#include"help.h"
@@ -269,11 +269,11 @@ helpSQL(const char *topic)
269269

270270
for (i=0;i<items_per_column;i++)
271271
{
272-
printf(" %-25s%-25s",
272+
printf("%-26s%-26s",
273273
VALUE_OR_NULL(QL_HELP[i].cmd),
274274
VALUE_OR_NULL(QL_HELP[i+items_per_column].cmd));
275275
if (i+2*items_per_column<QL_HELP_COUNT)
276-
printf("%-25s",
276+
printf("%-26s",
277277
VALUE_OR_NULL(QL_HELP[i+2*items_per_column].cmd));
278278
fputc('\n',stdout);
279279
}
@@ -283,10 +283,16 @@ helpSQL(const char *topic)
283283
{
284284
inti;
285285
boolhelp_found= false;
286+
size_tlen;
287+
288+
/* don't care about trailing spaces */
289+
len=strlen(topic);
290+
while (topic[len-1]==' ')
291+
len--;
286292

287293
for (i=0;QL_HELP[i].cmd;i++)
288294
{
289-
if (strcasecmp(QL_HELP[i].cmd,topic)==0||
295+
if (strncasecmp(topic,QL_HELP[i].cmd,len)==0||
290296
strcmp(topic,"*")==0)
291297
{
292298
help_found= true;
@@ -298,7 +304,7 @@ helpSQL(const char *topic)
298304
}
299305

300306
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);
302308
}
303309
}
304310

‎src/bin/psql/mainloop.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
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 $
77
*/
88
#include"postgres.h"
99
#include"mainloop.h"
@@ -297,6 +297,7 @@ MainLoop(FILE *source)
297297
else
298298
bslash_count=0;
299299

300+
rescan:
300301
/* in quote? */
301302
if (in_quote)
302303
{
@@ -382,7 +383,8 @@ MainLoop(FILE *source)
382383
free(line);
383384
line=new;
384385
len=strlen(new);
385-
continue;/* reparse the just substituted */
386+
387+
gotorescan;/* reparse the just substituted */
386388
}
387389
else
388390
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp