23 lines
459 B
C
23 lines
459 B
C
#include "time_header.h"
|
|
#include <dos/var.h>
|
|
|
|
void tzset_unlocked(void)
|
|
{
|
|
unsigned long memsize = ENVSIZE;
|
|
STRPTR var = (STRPTR)TZVARIABLE;
|
|
|
|
STRPTR buf = (char*)AllocMem(memsize, MEMF_ANY | MEMF_CLEAR);
|
|
if (!buf) {
|
|
return;
|
|
}
|
|
|
|
if (GetVar(var, buf, ENVSIZE - 1, GVF_GLOBAL_ONLY) > 0)
|
|
{
|
|
tzsetlcl(buf);
|
|
FreeMem(buf, memsize);
|
|
} else {
|
|
FreeMem(buf, memsize);
|
|
tzsetlcl(NULL);
|
|
}
|
|
}
|