Skip to content

Commit

Permalink
- fix for compilers that only support C89 syntax (e.g. on Windows)
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Nov 27, 2017
1 parent fd95f82 commit bc67db9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -10,6 +10,8 @@ For changes before version 3.0, see ``HISTORY.rst``.

- add Appveyor configuration to automate building Windows eggs

- fix for compilers that only support C89 syntax (e.g. on Windows)


4.0b1 (2017-09-15)
------------------
Expand Down
9 changes: 6 additions & 3 deletions src/AccessControl/cAccessControl.c
Expand Up @@ -775,13 +775,14 @@ static PyObject *
ZopeSecurityPolicy_getattro(ZopeSecurityPolicy *self, PyObject *name)
{
PyObject *name_as_bytes = NULL;
char *name_s;

if (NATIVE_CHECK(name) || PyUnicode_Check(name)) {
if ((name_as_bytes = convert_name(name)) == NULL) {
return NULL;
}

char *name_s = PyBytes_AS_STRING(name_as_bytes);
name_s = PyBytes_AS_STRING(name_as_bytes);

if (name_s[0] == '_') {
if (! strcmp(name_s, "_ownerous")) {
Expand Down Expand Up @@ -1425,13 +1426,14 @@ static PyObject *
SecurityManager_getattro(SecurityManager *self, PyObject *name)
{
PyObject *name_as_bytes = NULL;
char *name_s;

if (NATIVE_CHECK(name) || PyUnicode_Check(name)) {
if ((name_as_bytes = convert_name(name)) == NULL) {
return NULL;
}

char *name_s = PyBytes_AS_STRING(name_as_bytes);
name_s = PyBytes_AS_STRING(name_as_bytes);

if (name_s[0] == '_') {
if (! strcmp(name_s, "_thread_id") && self->thread_id) {
Expand Down Expand Up @@ -1463,13 +1465,14 @@ static int
SecurityManager_setattro(SecurityManager *self, PyObject *name, PyObject *v)
{
PyObject *name_as_bytes = NULL;
char *name_s;

if (NATIVE_CHECK(name) || PyUnicode_Check(name)) {
if ((name_as_bytes = convert_name(name)) == NULL) {
return -1;
}

char *name_s = PyBytes_AS_STRING(name_as_bytes);
name_s = PyBytes_AS_STRING(name_as_bytes);

if (name_s[0] == '_')
{
Expand Down

0 comments on commit bc67db9

Please sign in to comment.