![]() ![]() | ![]() |
File: [local] / OpenXM / misc / packages / Windows / debug-tools / gcwd.c (download)
Revision 1.2, Mon Jul 21 07:00:43 2003 UTC (21 years, 1 month ago) by takayama
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 " */