The R Project SVN R

Rev

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

Rev 73564 Rev 73849
Line 61... Line 61...
61
	    exit(1);
61
	    exit(1);
62
	}
62
	}
63
    } else if ((p = getenv("R_ARCH")))
63
    } else if ((p = getenv("R_ARCH")))
64
	strncpy(arch, p+1, 10); /* skip leading slash */
64
	strncpy(arch, p+1, 10); /* skip leading slash */
65
    
65
    
66
 
-
 
67
    if (stricmp(argv[0] + strlen(argv[0]) - 11, "Rscript.exe") == 0
66
    if (stricmp(argv[0] + strlen(argv[0]) - 11, "Rscript.exe") == 0
68
	|| stricmp(argv[0] + strlen(argv[0]) - 7, "Rscript") == 0)
67
	|| stricmp(argv[0] + strlen(argv[0]) - 7, "Rscript") == 0)
69
	snprintf(cmd, CMD_LEN, "\"%s\\bin\\%s\\Rscript.exe\"", getRHOME(2), arch);
68
	snprintf(cmd, CMD_LEN, "\"\"%s\\bin\\%s\\Rscript.exe\"", getRHOME(2), arch);
70
    else {
69
    else {
71
    	snprintf(cmd, CMD_LEN, "\"%s\\bin\\%s\\R.exe\"", getRHOME(2), arch);
70
    	snprintf(cmd, CMD_LEN, "\"\"%s\\bin\\%s\\R.exe\"", getRHOME(2), arch);
72
	interactive = 1;
71
	interactive = 1;
73
    }
72
    }
74
 
73
 
75
    for(int i = cmdarg; i < argc; i++) {
74
    for(int i = cmdarg; i < argc; i++) {
76
	if (interactive && !strcmp(argv[i], "CMD"))
75
	if (interactive && !strcmp(argv[i], "CMD"))
Line 81... Line 80...
81
	    /* We should really escape " here, I believe */
80
	    /* We should really escape " here, I believe */
82
	    strcat(cmd, argv[i]);
81
	    strcat(cmd, argv[i]);
83
	    strcat(cmd, "\"");
82
	    strcat(cmd, "\"");
84
	} else strcat(cmd, argv[i]);
83
	} else strcat(cmd, argv[i]);
85
    }
84
    }
-
 
85
    /* the outermost double quotes are needed for cmd.exe */
-
 
86
    strcat(cmd, "\"");
86
 
87
 
87
    if (interactive)
88
    if (interactive)
88
	/* Ignore Ctrl-C so that Rterm.exe can handle it */
89
	/* Ignore Ctrl-C so that Rterm.exe can handle it */
89
	SetConsoleCtrlHandler(NULL, TRUE);   
90
	SetConsoleCtrlHandler(NULL, TRUE);   
90
    
91