mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-15 08:20:16 +08:00
Fix some sloppiness in new PL/python get_source_line() function.
Jan Urbański
This commit is contained in:
parent
a53112338c
commit
b6bc481d55
@ -4484,12 +4484,11 @@ cleanup:
|
||||
static char *
|
||||
get_source_line(const char *src, int lineno)
|
||||
{
|
||||
const char *s;
|
||||
const char *next;
|
||||
const char *s = NULL;
|
||||
const char *next = src;
|
||||
int current = 0;
|
||||
|
||||
next = src;
|
||||
while (current != lineno)
|
||||
while (current < lineno)
|
||||
{
|
||||
s = next;
|
||||
next = strchr(s + 1, '\n');
|
||||
@ -4501,7 +4500,7 @@ get_source_line(const char *src, int lineno)
|
||||
if (current != lineno)
|
||||
return NULL;
|
||||
|
||||
while (s && isspace((unsigned char) *s))
|
||||
while (*s && isspace((unsigned char) *s))
|
||||
s++;
|
||||
|
||||
if (next == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user