From: pavenis AT lanet DOT lv Message-ID: To: Laurynas Biveinis , djgpp AT delorie DOT com, salvador AT inti DOT gov DOT ar Date: Tue, 24 Aug 1999 17:35:19 +0300 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: TV Patch In-reply-to: <37C23881.9E64C09B@softhome.net> X-mailer: Pegasus Mail for Win32 (v3.12a) Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 24 Aug 99, at 8:15, Laurynas Biveinis wrote: > salvador wrote: > > > > Laurynas Biveinis wrote: > > > > > Now about the real fix. Salvador, isn't somewhere in TV > > > function for converting backslashes to slashes? It should > > > go OK here. (Just I'm afraid that not only here, but in > > > many other places...) > > > > I don't know if that's a good idea because then the program will be compilable > > only under DOS. > > So I'm not so sure. > > How about > > #ifdef DJGPP > back2forwardslash(dir); > #endif > > Turbo Vision has to support both cases - 1) backslashes for porting > existing Borland C++ programs and 2) slashes for new DJGPP programs. > How about such functions: int isDirSeparator ( char c ) { return ( c=='/' #ifdef __DJGPP__ || c=='\\' #endif ) ? 1 : 0; } char * lastDirSeparator ( char * name ) { char *s, *res=0; for (s=name; *s; s++) if (isDirSeparator(*s)) res=s; return res; } So at least we would be able to avoid evil constructions like '\/' in file names