Annotation of OpenXM/rc/repl.c, Revision 1.3
1.3 ! noro 1: /* $OpenXM: OpenXM/rc/repl.c,v 1.2 2000/01/19 06:10:33 noro Exp $ */
1.1 takayama 2: #include <stdio.h>
3: #include <unistd.h>
1.3 ! noro 4: #include <string.h>
1.1 takayama 5:
6: #define BUFSIZE 10000
7: main() {
8: char s[BUFSIZE];
9: char cwd[BUFSIZE];
1.3 ! noro 10: char *slash;
! 11:
1.1 takayama 12: getcwd(cwd,BUFSIZE);
1.3 ! noro 13: slash = strrchr(cwd,'/');
! 14: *slash = 0;
1.1 takayama 15: while (fgets(s,BUFSIZE,stdin) != NULL) {
16: if (strcmp(s,"OpenXM_HOME=$HOME/OpenXM\n") == 0) {
1.3 ! noro 17: printf("OpenXM_HOME=%s\n",cwd);
1.1 takayama 18: }else if (strcmp(s,"setenv OpenXM_HOME $HOME/OpenXM\n") == 0) {
1.3 ! noro 19: printf("setenv OpenXM_HOME %s\n",cwd);
1.1 takayama 20: }else{
21: printf("%s",s);
22: }
23: }
1.2 noro 24: exit(0);
1.1 takayama 25: }
26:
27:
28:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>