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

Commitd768cb2

Browse files
committed
seemed like a typo in one of the appendix tables
Robert Treat
1 parentfdd9347 commitd768cb2

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

‎doc/src/sgml/datetime.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.34 2003/08/31 17:32:18 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.35 2003/09/11 16:22:42 momjian Exp $
33
-->
44

55
<appendix id="datetime-appendix">
@@ -344,7 +344,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.34 2003/08/31 17:32:18 pe
344344
</row>
345345
<row>
346346
<entry><literal>PM</literal></entry>
347-
<entry>Time is on or afterafter12:00</entry>
347+
<entry>Time is on or after 12:00</entry>
348348
</row>
349349
<row>
350350
<entry><literal>T</literal></entry>

‎src/bin/psql/help.c

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.78 2003/09/10 21:35:55 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.79 2003/09/11 16:22:42 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"common.h"
@@ -303,20 +303,41 @@ helpSQL(const char *topic, unsigned short int pager)
303303
{
304304
inti;
305305
boolhelp_found= false;
306+
FILE*output;
306307
size_tlen;
307-
308+
intnl_count=0;
309+
char*ch;
310+
308311
/* don't care about trailing spaces */
309312
len=strlen(topic);
310313
while (topic[len-1]==' ')
311314
len--;
312315

316+
/* Count newlines for pager */
317+
for (i=0;QL_HELP[i].cmd;i++)
318+
{
319+
if (strncasecmp(topic,QL_HELP[i].cmd,len)==0||
320+
strcmp(topic,"*")==0)
321+
{
322+
nl_count+=5;
323+
for (ch=QL_HELP[i].syntax;*ch!='\0';ch++)
324+
if (*ch=='\n')
325+
nl_count++;
326+
/* If we have an exact match, exit. Fixes \h SELECT */
327+
if (strcasecmp(topic,QL_HELP[i].cmd)==0)
328+
break;
329+
}
330+
}
331+
332+
output=PageOutput(nl_count,pager);
333+
313334
for (i=0;QL_HELP[i].cmd;i++)
314335
{
315336
if (strncasecmp(topic,QL_HELP[i].cmd,len)==0||
316337
strcmp(topic,"*")==0)
317338
{
318339
help_found= true;
319-
printf(_("Command: %s\n"
340+
fprintf(output,_("Command: %s\n"
320341
"Description: %s\n"
321342
"Syntax:\n%s\n\n"),
322343
QL_HELP[i].cmd,QL_HELP[i].help,QL_HELP[i].syntax);
@@ -327,7 +348,16 @@ helpSQL(const char *topic, unsigned short int pager)
327348
}
328349

329350
if (!help_found)
330-
printf(_("No help available for \"%-.*s\".\nTry \\h with no arguments to see available help.\n"), (int)len,topic);
351+
fprintf(output,_("No help available for \"%-.*s\".\nTry \\h with no arguments to see available help.\n"), (int)len,topic);
352+
353+
/* Only close if we used the pager */
354+
if (output!=stdout)
355+
{
356+
pclose(output);
357+
#ifndefWIN32
358+
pqsignal(SIGPIPE,SIG_DFL);
359+
#endif
360+
}
331361
}
332362
}
333363

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp