The R Project SVN R

Rev

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

Rev 84419 Rev 84987
Line 190... Line 190...
190
    char *p, cmd[CMD_LEN];
190
    char *p, cmd[CMD_LEN];
191
    char RCMD[] = "R CMD";
191
    char RCMD[] = "R CMD";
192
    int len = strlen(argv[0]);
192
    int len = strlen(argv[0]);
193
    char *env_path;
193
    char *env_path;
194
    int timing = 1;
194
    int timing = 1;
-
 
195
    int dirstrip = 2;
-
 
196
#ifdef R_ARCH
-
 
197
    if (strlen(R_ARCH) > 0)
-
 
198
	dirstrip++;
-
 
199
#endif 
195
    char *RHome = getRHOME(3);
200
    char *RHome = getRHOME(dirstrip);
196
 
201
 
197
    if(!RHome)
202
    if(!RHome)
198
        R_Suicide("Invalid R_HOME");
203
        R_Suicide("Invalid R_HOME");
199
 
204
 
200
    if(!strncmp(argv[0]+len-4, "Rcmd", 4) ||
205
    if(!strncmp(argv[0]+len-4, "Rcmd", 4) ||
Line 420... Line 425...
420
    /* no free here: storage remains in use */
425
    /* no free here: storage remains in use */
421
 
426
 
422
    char *Rarch = malloc(30);
427
    char *Rarch = malloc(30);
423
    if (!Rarch)
428
    if (!Rarch)
424
	R_Suicide("Allocation error");
429
	R_Suicide("Allocation error");
425
    strcpy(Rarch, "R_ARCH=/");
430
    strcpy(Rarch, "R_ARCH=");
-
 
431
#ifdef R_ARCH
-
 
432
    if (strlen(R_ARCH) > 0) {
-
 
433
	strcat(Rarch, "/");
426
    strcat(Rarch, R_ARCH);
434
	strcat(Rarch, R_ARCH);
-
 
435
    }
-
 
436
#endif
427
    putenv(Rarch);
437
    putenv(Rarch);
428
    /* no free here: storage remains in use */
438
    /* no free here: storage remains in use */
429
 
439
 
430
    R_putenv_path_cpy("BINDIR", BINDIR, 0);
440
    R_putenv_path_cpy("BINDIR", BINDIR, 0);
431
 
441