[BACK]Return to gcwd.c CVS log [TXT][DIR] Up to [local] / OpenXM / misc / packages / Windows / debug-tools

File: [local] / OpenXM / misc / packages / Windows / debug-tools / gcwd.c (download)

Revision 1.1, Mon Jul 21 07:00:04 2003 UTC (20 years, 11 months ago) by takayama
Branch: MAIN

New batch file to start from the CD.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* Set OpenXM_HOME for CD */
main() {
	char s[1024];
	char drive = 'c';
	char *systemdrive;
	getcwd(s,1023);
	if (strstr(s,"/cygdrive/")==s) {
		drive = s[10];  /* drive letter */
	}else{
		systemdrive = getenv("SystemDrive");
		if (systemdrive == NULL) {
			systemdrive = getenv("SYSTEMDRIVE");
		}
		if (systemdrive != NULL) {
			drive = systemdrive[0];
		}
	}
	printf("set OpenXM_HOME=/cygdrive/%c/OpenXM-win\n",drive);
	printf("set OpenXM_HOME_WIN=%c:\\OpenXM-win\n",drive);
}

/* Generate batch file a.bat and  "call a " */