Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
36ba263d
Commit
36ba263d
authored
Aug 13, 2010
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up failure to use ClosePager() where appropriate in help.c.
Also prevent possible repeat opening of pager in helpSQL().
parent
debcec7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
31 deletions
+9
-31
src/bin/psql/help.c
src/bin/psql/help.c
+9
-31
No files found.
src/bin/psql/help.c
View file @
36ba263d
...
...
@@ -3,12 +3,10 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.16
1 2010/08/12 00:40:59
tgl Exp $
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.16
2 2010/08/13 20:56:18
tgl Exp $
*/
#include "postgres_fe.h"
#include <signal.h>
#ifndef WIN32
#ifdef HAVE_PWD_H
#include <pwd.h>
/* for getpwuid() */
...
...
@@ -27,8 +25,6 @@
#include <termios.h>
#endif
#include "pqsignal.h"
#include "common.h"
#include "help.h"
#include "input.h"
...
...
@@ -271,13 +267,7 @@ slashUsage(unsigned short int pager)
"
\\
lo_list
\n
"
"
\\
lo_unlink LOBOID large object operations
\n
"
));
if
(
output
!=
stdout
)
{
pclose
(
output
);
#ifndef WIN32
pqsignal
(
SIGPIPE
,
SIG_DFL
);
#endif
}
ClosePager
(
output
);
}
...
...
@@ -334,14 +324,7 @@ helpSQL(const char *topic, unsigned short int pager)
fputc
(
'\n'
,
output
);
}
/* Only close if we used the pager */
if
(
output
!=
stdout
)
{
pclose
(
output
);
#ifndef WIN32
pqsignal
(
SIGPIPE
,
SIG_DFL
);
#endif
}
ClosePager
(
output
);
}
else
{
...
...
@@ -349,7 +332,7 @@ helpSQL(const char *topic, unsigned short int pager)
j
,
x
=
0
;
bool
help_found
=
false
;
FILE
*
output
;
FILE
*
output
=
NULL
;
size_t
len
,
wordlen
;
int
nl_count
=
0
;
...
...
@@ -376,7 +359,8 @@ helpSQL(const char *topic, unsigned short int pager)
}
if
(
wordlen
>=
len
)
/* Don't try again if the same word */
{
output
=
PageOutput
(
nl_count
,
pager
);
if
(
!
output
)
output
=
PageOutput
(
nl_count
,
pager
);
break
;
}
len
=
wordlen
;
...
...
@@ -396,7 +380,8 @@ helpSQL(const char *topic, unsigned short int pager)
}
}
output
=
PageOutput
(
nl_count
,
pager
);
if
(
!
output
)
output
=
PageOutput
(
nl_count
,
pager
);
for
(
i
=
0
;
QL_HELP
[
i
].
cmd
;
i
++
)
{
...
...
@@ -426,14 +411,7 @@ helpSQL(const char *topic, unsigned short int pager)
if
(
!
help_found
)
fprintf
(
output
,
_
(
"No help available for
\"
%s
\"
.
\n
Try
\\
h with no arguments to see available help.
\n
"
),
topic
);
/* Only close if we used the pager */
if
(
output
!=
stdout
)
{
pclose
(
output
);
#ifndef WIN32
pqsignal
(
SIGPIPE
,
SIG_DFL
);
#endif
}
ClosePager
(
output
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment