The R Project SVN R

Rev

Rev 90042 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 90042 Rev 90174
Line 318... Line 318...
318
#ifndef TZ_STRLEN_MAX
318
#ifndef TZ_STRLEN_MAX
319
#define TZ_STRLEN_MAX 255
319
#define TZ_STRLEN_MAX 255
320
#endif /* !defined TZ_STRLEN_MAX */
320
#endif /* !defined TZ_STRLEN_MAX */
321
 
321
 
322
static char		lcl_TZname[TZ_STRLEN_MAX + 1];
322
static char		lcl_TZname[TZ_STRLEN_MAX + 1];
323
static bool		lcl_is_set;
323
static int		lcl_is_set; // 'int' (can be negative); as iana.org's 2026b
324
static bool		gmt_is_set;
324
static bool		gmt_is_set;
325
 
325
 
326
char * tzname[2] = {
326
const char * tzname[2] = {
327
    wildabbr,
327
    wildabbr,
328
    wildabbr
328
    wildabbr
329
};
329
};
330
 
330
 
331
/*
331
/*
Line 1276... Line 1276...
1276
}
1276
}
1277
 
1277
 
1278
void
1278
void
1279
R_tzsetwall(void)
1279
R_tzsetwall(void)
1280
{
1280
{
1281
    if (!lcl_is_set) return;
1281
    if (lcl_is_set < 0) return;
1282
    lcl_is_set = false;
1282
    lcl_is_set = -1;
1283
 
1283
 
1284
    if (tzload((char *) NULL, lclptr, TRUE) != 0) gmtload(lclptr);
1284
    if (tzload((char *) NULL, lclptr, TRUE) != 0) gmtload(lclptr);
1285
    settzname();
1285
    settzname();
1286
}
1286
}
1287
 
1287
 
Line 1294... Line 1294...
1294
    if (name == NULL) {
1294
    if (name == NULL) {
1295
	R_tzsetwall();
1295
	R_tzsetwall();
1296
	return;
1296
	return;
1297
    }
1297
    }
1298
 
1298
 
1299
    if (lcl_is_set && strcmp(lcl_TZname, name) == 0)
1299
    if (lcl_is_set > 0 && strcmp(lcl_TZname, name) == 0)
1300
	return;
1300
	return;
1301
    lcl_is_set = strlen(name) < sizeof lcl_TZname;
1301
    lcl_is_set = strlen(name) < sizeof lcl_TZname;
1302
    /* R change: was strcpy before. */
1302
    /* R change: was strcpy before. */
1303
    if (lcl_is_set) {
1303
    if (lcl_is_set) {
1304
	(void) strncpy(lcl_TZname, name, TZ_STRLEN_MAX);
1304
	(void) strncpy(lcl_TZname, name, TZ_STRLEN_MAX);