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
29275c93
Commit
29275c93
authored
Sep 17, 2002
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deal with NULL fields in mkpwent.
parent
ceb7c18c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
Modules/pwdmodule.c
Modules/pwdmodule.c
+12
-1
No files found.
Modules/pwdmodule.c
View file @
29275c93
...
...
@@ -44,6 +44,17 @@ exception is raised if the entry asked for cannot be found.");
static
PyTypeObject
StructPwdType
;
static
void
sets
(
PyObject
*
v
,
int
i
,
char
*
val
)
{
if
(
val
)
PyStructSequence_SET_ITEM
(
v
,
i
,
PyString_FromString
(
val
));
else
{
PyStructSequence_SET_ITEM
(
v
,
i
,
Py_None
);
Py_INCREF
(
Py_None
);
}
}
static
PyObject
*
mkpwent
(
struct
passwd
*
p
)
{
...
...
@@ -53,7 +64,7 @@ mkpwent(struct passwd *p)
return
NULL
;
#define SETI(i,val) PyStructSequence_SET_ITEM(v, i, PyInt_FromLong((long) val))
#define SETS(i,val)
PyStructSequence_SET_ITEM(v, i, PyString_FromString(val)
)
#define SETS(i,val)
sets(v, i, val
)
SETS
(
setIndex
++
,
p
->
pw_name
);
SETS
(
setIndex
++
,
p
->
pw_passwd
);
...
...
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