[BACK]Return to repl.c CVS log [TXT][DIR] Up to [local] / OpenXM / rc

File: [local] / OpenXM / rc / repl.c (download)

Revision 1.2, Wed Jan 19 06:10:33 2000 UTC (24 years, 3 months ago) by noro
Branch: MAIN
Changes since 1.1: +2 -1 lines

Added 'exit(0)' on exit.

/* $OpenXM: OpenXM/rc/repl.c,v 1.2 2000/01/19 06:10:33 noro Exp $ */
#include <stdio.h>
#include <unistd.h>

#define BUFSIZE 10000
main() {
  char s[BUFSIZE];
  char cwd[BUFSIZE];
  getcwd(cwd,BUFSIZE);
  while (fgets(s,BUFSIZE,stdin) != NULL) {
	if (strcmp(s,"OpenXM_HOME=$HOME/OpenXM\n") == 0) {
	  printf("OpenXM_HOME=%s/../../OpenXM\n",cwd);
	}else if (strcmp(s,"setenv OpenXM_HOME $HOME/OpenXM\n") == 0) {
	  printf("setenv OpenXM_HOME %s/../../OpenXM\n",cwd);
	}else{
	  printf("%s",s);
	}
  }
  exit(0);
}