www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/24/16:33:53

From: pavenis AT lanet DOT lv
Message-ID: <B0000099190@stargate.astr.lu.lv>
To: Laurynas Biveinis <lauras AT softhome DOT net>, 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
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

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019