summaryrefslogtreecommitdiffstats
path: root/src/intrf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-05-14 21:26:03 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-05-14 21:26:03 +0200
commita5858ff5864d67e556b813ae510630772c00d32b (patch)
tree521f3f482d3edd6f07577f35c160d5a618a48d5e /src/intrf.c
parent9326a06b205339c7ae6e72cbc7c1c79f5e99c59a (diff)
Fix filename_to_directory() for cygwin
Diffstat (limited to 'src/intrf.c')
-rw-r--r--src/intrf.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/intrf.c b/src/intrf.c
index c1b2bf4..219cf46 100644
--- a/src/intrf.c
+++ b/src/intrf.c
@@ -1154,18 +1154,19 @@ static char *filename_to_directory(const char *filename)
#ifdef HAVE_GETCWD
if(res!=NULL && strcmp(res,".")==0 && getcwd(buf, sizeof(buf)-1)!=NULL)
{
+ buf[sizeof(buf)-1]='\0';
+ res=buf;
+ }
+#endif
#ifdef __CYGWIN__
+ {
char beautifull_dst_directory[2048];
- buf[sizeof(buf)-1]='\0';
- cygwin_conv_to_win32_path(buf, beautifull_dst_directory);
+ cygwin_conv_to_win32_path(res, beautifull_dst_directory);
return strdup(beautifull_dst_directory);
-#else
- buf[sizeof(buf)-1]='\0';
- return strdup(buf);
-#endif
}
-#endif
+#else
return strdup(res);
+#endif
}
int start_ncurses(const char *prog_name, const char *real_prog_name)