Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Side by Side Diff: Python/codecs.c

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Python/ceval.c ('k') | Python/makeopcodetargets.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* ------------------------------------------------------------------------ 1 /* ------------------------------------------------------------------------
2 2
3 Python Codec Registry and support functions 3 Python Codec Registry and support functions
4 4
5 Written by Marc-Andre Lemburg (mal@lemburg.com). 5 Written by Marc-Andre Lemburg (mal@lemburg.com).
6 6
7 Copyright (c) Corporation for National Research Initiatives. 7 Copyright (c) Corporation for National Research Initiatives.
8 8
9 ------------------------------------------------------------------------ */ 9 ------------------------------------------------------------------------ */
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 p = PyMem_Malloc(len + 1); 64 p = PyMem_Malloc(len + 1);
65 if (p == NULL) 65 if (p == NULL)
66 return NULL; 66 return NULL;
67 for (i = 0; i < len; i++) { 67 for (i = 0; i < len; i++) {
68 register char ch = string[i]; 68 register char ch = string[i];
69 if (ch == ' ') 69 if (ch == ' ')
70 ch = '-'; 70 ch = '-';
71 else 71 else
72 ch = Py_TOLOWER(Py_CHARMASK(ch)); 72 ch = tolower(Py_CHARMASK(ch));
73 p[i] = ch; 73 p[i] = ch;
74 } 74 }
75 p[i] = '\0'; 75 p[i] = '\0';
76 v = PyUnicode_FromString(p); 76 v = PyUnicode_FromString(p);
77 if (v == NULL) 77 if (v == NULL)
78 return NULL; 78 return NULL;
79 PyMem_Free(p); 79 PyMem_Free(p);
80 return v; 80 return v;
81 } 81 }
82 82
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 configuration are still reported back to the user. */ 1075 configuration are still reported back to the user. */
1076 PyErr_Clear(); 1076 PyErr_Clear();
1077 return 0; 1077 return 0;
1078 } 1078 }
1079 return -1; 1079 return -1;
1080 } 1080 }
1081 Py_DECREF(mod); 1081 Py_DECREF(mod);
1082 interp->codecs_initialized = 1; 1082 interp->codecs_initialized = 1;
1083 return 0; 1083 return 0;
1084 } 1084 }
OLDNEW
« no previous file with comments | « Python/ceval.c ('k') | Python/makeopcodetargets.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+