FreeBSD/contrib/subversion/subversion/libsvn_fs_x/low_level.c
/* If PATH needs to be escaped, return an escaped version of it, allocated
 * from RESULT_POOL. Otherwise, return PATH directly. */
If PATH needs to be escaped, return an escaped version of it, allocated
from RESULT_POOL. Otherwise, return PATH directly.
If PATH needs to be escaped return an escaped version of it allocated from RESULT_POOL . Otherwise return PATH directly .
static const char *
auto_escape_path(const char *path,
                 apr_pool_t *result_pool)
{
  apr_size_t len = strlen(path);
  apr_size_t i;
  const char esc = '\x1b';
  for (i = 0; i < len; ++i)
    if (path[i] < ' ')
      {
        svn_stringbuf_t *escaped = svn_stringbuf_create_ensure(2 * len,
                                                               result_pool);
        for (i = 0; i < len; ++i)
          if (path[i] < ' ')
            {
              svn_stringbuf_appendbyte(escaped, esc);
              svn_stringbuf_appendbyte(escaped, path[i] + 'A' - 1);
            }
          else
            {
              svn_stringbuf_appendbyte(escaped, path[i]);
            }
        return escaped->data;
      }
   return path;
}
static const char * auto_escape_path ( const char * path , apr_pool_t * result_pool ) { apr_size_t len = strlen ( path ) ; apr_size_t i ; const char esc = ' \x1b ' ; for ( i = 0 ; i < len ; ++ i ) if ( path [ i ] < ' ' ) { svn_stringbuf_t * escaped = svn_stringbuf_create_ensure ( 2 * len , result_pool ) ; for ( i = 0 ; i < len ; ++ i ) if ( path [ i ] < ' ' ) { svn_stringbuf_appendbyte ( escaped , esc ) ; svn_stringbuf_appendbyte ( escaped , path [ i ] + ' ' - 1 ) ; } else { svn_stringbuf_appendbyte ( escaped , path [ i ] ) ; } return escaped -> data ; } return path ; }
If PATH needs to be escaped, return an escaped version of it, allocated
 from RESULT_POOL.
If PATH needs to be escaped return an escaped version of it allocated from RESULT_POOL .