Mail Archives: djgpp/1999/08/24/16:33:53
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
- Raw text -