aboutsummaryrefslogtreecommitdiffstats
path: root/src/fns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/fns.c b/src/fns.c
index dd05f1f4ca7..07663830248 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3135,8 +3135,10 @@ The data read from the system are decoded using `locale-coding-system'. */)
3135 else if (EQ (item, Qdays)) /* e.g. for calendar-day-name-array */ 3135 else if (EQ (item, Qdays)) /* e.g. for calendar-day-name-array */
3136 { 3136 {
3137 Lisp_Object v = Fmake_vector (make_number (7), Qnil); 3137 Lisp_Object v = Fmake_vector (make_number (7), Qnil);
3138 int days[7] = {DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7}; 3138 const int days[7] = {DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7};
3139 int i; 3139 int i;
3140 struct gcpro gcpro1;
3141 GCPRO1 (v);
3140 synchronize_system_time_locale (); 3142 synchronize_system_time_locale ();
3141 for (i = 0; i < 7; i++) 3143 for (i = 0; i < 7; i++)
3142 { 3144 {
@@ -3148,26 +3150,29 @@ The data read from the system are decoded using `locale-coding-system'. */)
3148 code_convert_string_norecord (val, Vlocale_coding_system, 3150 code_convert_string_norecord (val, Vlocale_coding_system,
3149 0)); 3151 0));
3150 } 3152 }
3153 UNGCPRO;
3151 return v; 3154 return v;
3152 } 3155 }
3153#endif /* DAY_1 */ 3156#endif /* DAY_1 */
3154#ifdef MON_1 3157#ifdef MON_1
3155 else if (EQ (item, Qmonths)) /* e.g. for calendar-month-name-array */ 3158 else if (EQ (item, Qmonths)) /* e.g. for calendar-month-name-array */
3156 { 3159 {
3157 struct Lisp_Vector *p = allocate_vector (12); 3160 Lisp_Object v = Fmake_vector (make_number (12), Qnil);
3158 int months[12] = {MON_1, MON_2, MON_3, MON_4, MON_5, MON_6, MON_7, 3161 const int months[12] = {MON_1, MON_2, MON_3, MON_4, MON_5, MON_6, MON_7,
3159 MON_8, MON_9, MON_10, MON_11, MON_12}; 3162 MON_8, MON_9, MON_10, MON_11, MON_12};
3160 int i; 3163 int i;
3164 struct gcpro gcpro1;
3165 GCPRO1 (v);
3161 synchronize_system_time_locale (); 3166 synchronize_system_time_locale ();
3162 for (i = 0; i < 12; i++) 3167 for (i = 0; i < 12; i++)
3163 { 3168 {
3164 str = nl_langinfo (months[i]); 3169 str = nl_langinfo (months[i]);
3165 val = make_unibyte_string (str, strlen (str)); 3170 val = make_unibyte_string (str, strlen (str));
3166 p->contents[i] = 3171 Faset (v, make_number (i),
3167 code_convert_string_norecord (val, Vlocale_coding_system, 0); 3172 code_convert_string_norecord (val, Vlocale_coding_system, 0));
3168 } 3173 }
3169 XSETVECTOR (val, p); 3174 UNGCPRO;
3170 return val; 3175 return v;
3171 } 3176 }
3172#endif /* MON_1 */ 3177#endif /* MON_1 */
3173/* LC_PAPER stuff isn't defined as accessible in glibc as of 2.3.1, 3178/* LC_PAPER stuff isn't defined as accessible in glibc as of 2.3.1,