The R Project SVN R

Rev

Rev 6648 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6648 Rev 6994
Line 523... Line 523...
523
    putenv(buf);
523
    putenv(buf);
524
}
524
}
525
 
525
 
526
static void processRenviron()
526
static void processRenviron()
527
{
527
{
528
    char *opt[2], optf[MAX_PATH], buf[80];
528
    char *opt[2], optf[MAX_PATH], buf[80], *tmp;
529
    int   ok;
529
    int   ok;
530
 
530
 
531
 
531
 
532
    if (!optopenfile(".Renviron")) {
532
    if (!optopenfile(".Renviron")) {
-
 
533
	/* R_USER is not necessarily set yet, so we have to work harder */
-
 
534
	tmp = getenv("R_USER");
-
 
535
	if(!tmp) tmp = getenv("HOME");
-
 
536
	if(!tmp) return;
533
	sprintf(optf, "%s/.Renviron", getenv("R_USER"));
537
	sprintf(optf, "%s/.Renviron", tmp);
534
	if (!optopenfile(optf)) return;
538
	if (!optopenfile(optf)) return;
535
    }
539
    }
536
    while ((ok = optread(opt, '='))) {
540
    while ((ok = optread(opt, '='))) {
537
	sprintf(buf, "%s=%s", opt[0], opt[1]);
541
	sprintf(buf, "%s=%s", opt[0], opt[1]);
538
	Putenv(buf);
542
	Putenv(buf);