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

Annotation of OpenXM/misc/packages/Windows/debug-tools/gcwd.c, Revision 1.2

1.2     ! takayama    1: /* $OpenXM$ */
1.1       takayama    2: #include <stdio.h>
                      3: #include <stdlib.h>
                      4: #include <string.h>
                      5:
                      6: /* Set OpenXM_HOME for CD */
                      7: main() {
                      8:        char s[1024];
                      9:        char drive = 'c';
                     10:        char *systemdrive;
                     11:        getcwd(s,1023);
                     12:        if (strstr(s,"/cygdrive/")==s) {
                     13:                drive = s[10];  /* drive letter */
                     14:        }else{
                     15:                systemdrive = getenv("SystemDrive");
                     16:                if (systemdrive == NULL) {
                     17:                        systemdrive = getenv("SYSTEMDRIVE");
                     18:                }
                     19:                if (systemdrive != NULL) {
                     20:                        drive = systemdrive[0];
                     21:                }
                     22:        }
                     23:        printf("set OpenXM_HOME=/cygdrive/%c/OpenXM-win\n",drive);
                     24:        printf("set OpenXM_HOME_WIN=%c:\\OpenXM-win\n",drive);
                     25: }
                     26:
                     27: /* Generate batch file a.bat and  "call a " */
                     28:
                     29:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>