From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii To: gdb@sources.redhat.com Cc: ac131313@cygnus.com Subject: DOS/Windows-specific code: main.c Date: Tue, 08 May 2001 04:46:00 -0000 Message-id: <200105081148.OAA06240@is.elta.co.il> References: <20010503211502.21716.qmail@web6401.mail.yahoo.com> <3AF1DAA0.3060702@cygnus.com> <200105071609.TAA24129@is.elta.co.il> X-SW-Source: 2001-05/msg00104.html * main.c: #ifdef __CYGWIN__ #include /* for MAX_PATH */ #include /* for cygwin32_conv_to_posix_path */ #endif See the next snippet. * main.c:captured_main() /* Read and execute $HOME/.gdbinit file, if it exists. This is done *before* all the command line arguments are processed; it sets global parameters, which are independent of what file you are debugging or what directory you are in. */ #ifdef __CYGWIN32__ { char *tmp = getenv ("HOME"); if (tmp != NULL) { homedir = (char *) alloca (MAX_PATH + 1); cygwin32_conv_to_posix_path (tmp, homedir); } else homedir = NULL; } #else homedir = getenv ("HOME"); #endif What does cygwin32_conv_to_posix_path do? Does it convert the drive-letter braindamage to the /cygdrive/d/foo thingy? If so, why is that needed? Doesn't Cygwin support the native Windows file names with drive letters? In any case, this could use FILENAME_MAX instead of MAX_PATH, and then the previous snippet would not need , since stdio.h is already included by defs.h.