[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.2, Mon Jul 21 07:00:43 2003 UTC (20 years, 10 months ago) by takayama
Branch: MAIN
CVS Tags: R_1_3_1-2, RELEASE_1_3_1_13b, RELEASE_1_2_3_12, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, KNOPPIX_2006, HEAD, DEB_REL_1_2_3-9
Changes since 1.1: +1 -0 lines

I forgot the OpenXM tag.

/* $OpenXM: OpenXM/misc/packages/Windows/debug-tools/gcwd.c,v 1.2 2003/07/21 07:00:43 takayama Exp $ */
#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 " */