8000 Correctly support scanning zero-length strings. · alex-python/pyScss@2411a28 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2411a28

Browse files
committed
Correctly support scanning zero-length strings.
1 parent 8b163b8 commit 2411a28

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

scss/src/scanner.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,16 +303,14 @@ Scanner_reset(Scanner *self, char *input, int input_sz) {
303303
}
304304
self->tokens_sz = 0;
305305

306-
if (input_sz) {
307-
if (self->input != NULL) {
308-
PyMem_Del(self->input);
309-
}
310-
self->input = PyMem_Strndup(input, input_sz);
311-
self->input_sz = input_sz;
312-
#ifdef DEBUG
313-
fprintf(stderr, "Scanning in %s\n", repr(self->input));
314-
#endif
306+
if (self->input != NULL) {
307+
PyMem_Del(self->input);
315308
}
309+
self->input = PyMem_Strndup(input, input_sz);
310+
self->input_sz = input_sz;
311+
#ifdef DEBUG
312+
fprintf(stderr, "Scanning in %s\n", repr(self->input));
313+
#endif
316314

317315
self->pos = 0;
318316
}

0 commit comments

Comments
 (0)
0