version 1.10, 2004/02/05 10:35:04 |
version 1.12, 2004/10/14 10:08:09 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/shell.c,v 1.9 2003/12/13 13:29:44 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/shell.c,v 1.11 2004/02/23 09:03:42 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
Line 125 static struct object KoxShell_test1(struct object ob) |
|
Line 125 static struct object KoxShell_test1(struct object ob) |
|
rob = testmain(ob); |
rob = testmain(ob); |
}else if (strcmp(cmd,"which")==0) { |
}else if (strcmp(cmd,"which")==0) { |
if (n == 2) { |
if (n == 2) { |
|
pathFinderErrorVerbose(0); |
rob = KoxWhich(getoa(ob,1),KpoInteger(0)); |
rob = KoxWhich(getoa(ob,1),KpoInteger(0)); |
|
pathFinderErrorVerbose(-1); |
}else if (n==3) { |
}else if (n==3) { |
|
pathFinderErrorVerbose(0); |
rob = KoxWhich(getoa(ob,1),getoa(ob,2)); |
rob = KoxWhich(getoa(ob,1),getoa(ob,2)); |
|
pathFinderErrorVerbose(-1); |
}else{ |
}else{ |
errorKan1("%s\n","shell: << which command-name >> or << which command-name path >>"); |
errorKan1("%s\n","shell: << which command-name >> or << which command-name path >>"); |
} |
} |
Line 180 static int mysetenv(char *name, char *value, int overw |
|
Line 184 static int mysetenv(char *name, char *value, int overw |
|
char *orig; |
char *orig; |
s = (char *)getenv(name); |
s = (char *)getenv(name); |
if ((s == NULL) || overwrite) { |
if ((s == NULL) || overwrite) { |
s = (char *) malloc(strlen(name)+strlen(value)+5); |
s = (char *) mymalloc(strlen(name)+strlen(value)+5); |
if (s == 0) { fprintf(stderr,"No more memory.\n"); exit(10); } |
if (s == 0) { fprintf(stderr,"No more memory.\n"); exit(10); } |
strcpy(s,name); |
strcpy(s,name); |
strcat(s,"="); strcat(s,value); |
strcat(s,"="); strcat(s,value); |