[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.1

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

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