projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a531123
)
Fix some sloppiness in new PL/python get_source_line() function.
author
Robert Haas
<rhaas@postgresql.org>
Fri, 8 Apr 2011 04:30:54 +0000
(
00:30
-0400)
committer
Robert Haas
<rhaas@postgresql.org>
Fri, 8 Apr 2011 04:31:58 +0000
(
00:31
-0400)
Jan UrbaĆski
src/pl/plpython/plpython.c
patch
|
blob
|
blame
|
history
diff --git
a/src/pl/plpython/plpython.c
b/src/pl/plpython/plpython.c
index 935258044db5ff0a7e1b2268d04afca095527b73..47d898a9765401fe0ccf6adf563c5f9166df7ecf 100644
(file)
--- a/
src/pl/plpython/plpython.c
+++ b/
src/pl/plpython/plpython.c
@@
-4484,12
+4484,11
@@
cleanup:
static char *
get_source_line(const char *src, int lineno)
{
- const char
*s
;
- const char
*next
;
- int current = 0;
+ 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)