summaryrefslogtreecommitdiffstats
path: root/dimension
diff options
context:
space:
mode:
Diffstat (limited to 'dimension')
-rw-r--r--dimension/tokenize.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/dimension/tokenize.c b/dimension/tokenize.c
index 508d6d7..03a6a6f 100644
--- a/dimension/tokenize.c
+++ b/dimension/tokenize.c
@@ -388,14 +388,6 @@ dmnsn_tokenize_directive(const char *filename,
dmnsn_array *
dmnsn_tokenize(const char *filename, FILE *file)
{
- /* Save the current locale */
- char *lc_ctype = strdup(setlocale(LC_CTYPE, NULL));
- char *lc_numeric = strdup(setlocale(LC_NUMERIC, NULL));
-
- /* Set the locale to `C' to make isalpha(), strtoul(), etc. consistent */
- setlocale(LC_CTYPE, "C");
- setlocale(LC_NUMERIC, "C");
-
if (fseeko(file, 0, SEEK_END) != 0) {
fprintf(stderr, "Couldn't seek on input stream\n");
return NULL;
@@ -416,6 +408,14 @@ dmnsn_tokenize(const char *filename, FILE *file)
return NULL;
}
+ /* Save the current locale */
+ char *lc_ctype = strdup(setlocale(LC_CTYPE, NULL));
+ char *lc_numeric = strdup(setlocale(LC_NUMERIC, NULL));
+
+ /* Set the locale to `C' to make isalpha(), strtoul(), etc. consistent */
+ setlocale(LC_CTYPE, "C");
+ setlocale(LC_NUMERIC, "C");
+
dmnsn_token token;
dmnsn_array *tokens = dmnsn_new_array(sizeof(dmnsn_token));