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
4b77bfc3
Commit
4b77bfc3
authored
Jan 31, 2012
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
psql: Reduce the amount of const lies a bit
parent
88a6ac9f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/bin/psql/tab-complete.c
src/bin/psql/tab-complete.c
+6
-6
No files found.
src/bin/psql/tab-complete.c
View file @
4b77bfc3
...
...
@@ -3364,13 +3364,13 @@ complete_from_variables(char *text, const char *prefix, const char *suffix)
{
char
**
matches
;
int
overhead
=
strlen
(
prefix
)
+
strlen
(
suffix
)
+
1
;
c
onst
char
**
varnames
;
c
har
**
varnames
;
int
nvars
=
0
;
int
maxvars
=
100
;
int
i
;
struct
_variable
*
ptr
;
varnames
=
(
c
onst
c
har
**
)
pg_malloc
((
maxvars
+
1
)
*
sizeof
(
char
*
));
varnames
=
(
char
**
)
pg_malloc
((
maxvars
+
1
)
*
sizeof
(
char
*
));
for
(
ptr
=
pset
.
vars
->
next
;
ptr
;
ptr
=
ptr
->
next
)
{
...
...
@@ -3379,7 +3379,7 @@ complete_from_variables(char *text, const char *prefix, const char *suffix)
if
(
nvars
>=
maxvars
)
{
maxvars
*=
2
;
varnames
=
(
c
onst
c
har
**
)
realloc
(
varnames
,
varnames
=
(
char
**
)
realloc
(
varnames
,
(
maxvars
+
1
)
*
sizeof
(
char
*
));
if
(
!
varnames
)
{
...
...
@@ -3394,10 +3394,10 @@ complete_from_variables(char *text, const char *prefix, const char *suffix)
}
varnames
[
nvars
]
=
NULL
;
COMPLETE_WITH_LIST
(
varnames
);
COMPLETE_WITH_LIST
(
(
const
char
*
const
*
)
varnames
);
for
(
i
=
0
;
i
<
nvars
;
i
++
)
free
(
(
void
*
)
varnames
[
i
]);
free
(
varnames
[
i
]);
free
(
varnames
);
return
matches
;
...
...
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