Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
861d09ec
Commit
861d09ec
authored
Jan 31, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid using isspace() due to problem on MacOS-X (Mavericks) and because it is locale dependent
parent
caa43e47
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
Cython/Utility/Buffer.c
Cython/Utility/Buffer.c
+5
-2
Cython/Utility/Printing.c
Cython/Utility/Printing.c
+10
-4
No files found.
Cython/Utility/Buffer.c
View file @
861d09ec
...
...
@@ -593,8 +593,11 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
/* Parse all numbers in the format string */
while
(
*
ts
&&
*
ts
!=
')'
)
{
if
(
isspace
(
*
ts
))
continue
;
// ignore space characters (not using isspace() due to C/C++ problem on MacOS-X)
switch
(
*
ts
)
{
case
' '
:
case
'\f'
:
case
'\r'
:
case
'\n'
:
case
'\t'
:
case
'\v'
:
continue
;
default:
break
;
/* not a 'break' in the loop */
}
number
=
__Pyx_BufFmt_ExpectNumber
(
&
ts
);
if
(
number
==
-
1
)
return
NULL
;
...
...
Cython/Utility/Printing.c
View file @
861d09ec
...
...
@@ -47,10 +47,16 @@ static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
if
(
PyString_Check
(
v
))
{
char
*
s
=
PyString_AsString
(
v
);
Py_ssize_t
len
=
PyString_Size
(
v
);
if
(
len
>
0
&&
isspace
(
Py_CHARMASK
(
s
[
len
-
1
]))
&&
s
[
len
-
1
]
!=
' '
)
if
(
len
>
0
)
{
// append soft-space if necessary (not using isspace() due to C/C++ problem on MacOS-X)
switch
(
s
[
len
-
1
])
{
case
' '
:
break
;
case
'\f'
:
case
'\r'
:
case
'\n'
:
case
'\t'
:
case
'\v'
:
PyFile_SoftSpace
(
f
,
0
);
break
;
default:
break
;
}
}
}
}
if
(
newline
)
{
...
...
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