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

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

Revision 1.3, Thu Jan 20 02:34:49 2000 UTC (24 years, 3 months ago) by noro
Branch: MAIN
CVS Tags: maekawa-ipv6, RELEASE_20000124, RELEASE_1_1_3, RELEASE_1_1_2
Changes since 1.2: +8 -3 lines

Shortened the directory names generated by repl.

/* $OpenXM: OpenXM/rc/repl.c,v 1.3 2000/01/20 02:34:49 noro Exp $ */
#include <stdio.h>
#include <unistd.h>
#include <string.h>

#define BUFSIZE 10000
main() {
  char s[BUFSIZE];
  char cwd[BUFSIZE];
  char *slash;

  getcwd(cwd,BUFSIZE);
  slash = strrchr(cwd,'/');
  *slash = 0;
  while (fgets(s,BUFSIZE,stdin) != NULL) {
	if (strcmp(s,"OpenXM_HOME=$HOME/OpenXM\n") == 0) {
	  printf("OpenXM_HOME=%s\n",cwd);
	}else if (strcmp(s,"setenv OpenXM_HOME $HOME/OpenXM\n") == 0) {
	  printf("setenv OpenXM_HOME %s\n",cwd);
	}else{
	  printf("%s",s);
	}
  }
  exit(0);
}