Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f7628f47
Commit
f7628f47
authored
Jan 05, 2002
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize err_ret with filename if available. Fixes #498828.
parent
1001c248
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Parser/parsetok.c
Parser/parsetok.c
+5
-5
No files found.
Parser/parsetok.c
View file @
f7628f47
...
...
@@ -14,7 +14,7 @@ int Py_TabcheckFlag;
/* Forward */
static
node
*
parsetok
(
struct
tok_state
*
,
grammar
*
,
int
,
perrdetail
*
,
int
);
static
void
initerr
(
perrdetail
*
err_ret
);
static
void
initerr
(
perrdetail
*
err_ret
,
char
*
filename
);
/* Parse input coming from a string. Return error code, print some errors. */
node
*
...
...
@@ -29,7 +29,7 @@ PyParser_ParseStringFlags(char *s, grammar *g, int start,
{
struct
tok_state
*
tok
;
initerr
(
err_ret
);
initerr
(
err_ret
,
NULL
);
if
((
tok
=
PyTokenizer_FromString
(
s
))
==
NULL
)
{
err_ret
->
error
=
E_NOMEM
;
...
...
@@ -63,7 +63,7 @@ PyParser_ParseFileFlags(FILE *fp, char *filename, grammar *g, int start,
{
struct
tok_state
*
tok
;
initerr
(
err_ret
);
initerr
(
err_ret
,
filename
);
if
((
tok
=
PyTokenizer_FromFile
(
fp
,
ps1
,
ps2
))
==
NULL
)
{
err_ret
->
error
=
E_NOMEM
;
...
...
@@ -178,10 +178,10 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
}
static
void
initerr
(
perrdetail
*
err_ret
)
initerr
(
perrdetail
*
err_ret
,
char
*
filename
)
{
err_ret
->
error
=
E_OK
;
err_ret
->
filename
=
NULL
;
err_ret
->
filename
=
filename
;
err_ret
->
lineno
=
0
;
err_ret
->
offset
=
0
;
err_ret
->
text
=
NULL
;
...
...
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