From 521ab78b9a2ae324f158836c6199374ded8f4986 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 29 Oct 2002 20:07:34 +0000 Subject: Fix file chooser absolute path bug. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2706 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_File_Chooser2.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 92035f05e..ff4976abb 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.24 2002/10/28 15:00:56 easysw Exp $" +// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.25 2002/10/29 20:07:34 easysw Exp $" // // More Fl_File_Chooser routines. // @@ -522,17 +522,15 @@ Fl_File_Chooser::fileNameCB() if (slash != NULL) { // Yes, change directories if necessary... - if (slash > pathname) // Special case for "/" - *slash++ = '\0'; - else - slash++; - + *slash++ = '\0'; filename = slash; #if defined(WIN32) || defined(__EMX__) - if (strcasecmp(pathname, directory_)) { + if (strcasecmp(pathname, directory_) && + (pathname[0] || strcasecmp("/", directory_))) { #else - if (strcmp(pathname, directory_)) { + if (strcmp(pathname, directory_) && + (pathname[0] || strcasecmp("/", directory_))) { #endif // WIN32 || __EMX__ int p = fileName->position(); int m = fileName->mark(); @@ -1149,5 +1147,5 @@ unquote_pathname(char *dst, // O - Destination string // -// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.24 2002/10/28 15:00:56 easysw Exp $". +// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.25 2002/10/29 20:07:34 easysw Exp $". // -- cgit v1.2.3