components/prboom/d_deh.c
// ====================================================================
// dehReformatStr
// Purpose: Convert a string into a continuous string with embedded
//          linefeeds for "\n" sequences in the source string
// Args:    string -- the string to convert
// Returns: the converted string (converted in a static buffer)
//
dehReformatStr
Purpose: Convert a string into a continuous string with embedded
linefeeds for "\n" sequences in the source string
Args:    string -- the string to convert
Returns: the converted string (converted in a static buffer)
dehReformatStr Purpose : Convert a string into a continuous string with embedded linefeeds for " \ n " sequences in the source string Args : string -- the string to convert Returns : the converted string ( converted in a static buffer )
char *dehReformatStr(char *string)
{
  static char buff[DEH_BUFFERMAX]; 
  char *s, *t;
  s = string;  
  t = buff;    
  while (*s)
    {
      if (*s == '\n')
        ++s, *t++ = '\\', *t++ = 'n', *t++ = '\\', *t++='\n';
      else
        *t++ = *s++;
    }
  *t = '\0';
  return buff;
}
char * dehReformatStr ( char * string ) { static char buff [ DEH_BUFFERMAX ] ; char * s , * t ; s = string ; t = buff ; while ( * s ) { if ( * s == ' \n ' ) ++ s , * t ++ = ' \\ ' , * t ++ = ' ' , * t ++ = ' \\ ' , * t ++ = ' \n ' ; else * t ++ = * s ++ ; } * t = ' \0 ' ; return buff ; }
dehReformatStr
Purpose: Convert a string into a continuous string with embedded
linefeeds for "\n" sequences in the source string
Args:    string -- the string to convert
Returns: the converted string (converted in a static buffer)
dehReformatStr Purpose : Convert a string into a continuous string with embedded linefeeds for " \ n " sequences in the source string Args : string -- the string to convert Returns : the converted string ( converted in a static buffer )
// only processing the changed string, //  don't need double buffer // source // target // let's play...