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

Commitb6bc481

Browse files
committed
Fix some sloppiness in new PL/python get_source_line() function.
Jan Urbański
1 parenta531123 commitb6bc481

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎src/pl/plpython/plpython.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4484,12 +4484,11 @@ PLy_get_spi_error_data(PyObject *exc, char **detail, char **hint, char **query,
44844484
staticchar*
44854485
get_source_line(constchar*src,intlineno)
44864486
{
4487-
constchar*s;
4488-
constchar*next;
4489-
intcurrent=0;
4487+
constchar*s=NULL;
4488+
constchar*next=src;
4489+
intcurrent=0;
44904490

4491-
next=src;
4492-
while (current!=lineno)
4491+
while (current<lineno)
44934492
{
44944493
s=next;
44954494
next=strchr(s+1,'\n');
@@ -4501,7 +4500,7 @@ get_source_line(const char *src, int lineno)
45014500
if (current!=lineno)
45024501
returnNULL;
45034502

4504-
while (s&&isspace((unsignedchar)*s))
4503+
while (*s&&isspace((unsignedchar)*s))
45054504
s++;
45064505

45074506
if (next==NULL)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp