FreeBSD/contrib/subversion/subversion/libsvn_fs_x/caching.c
/* Take the ORIGINAL string and replace all occurrences of ":" without
 * limiting the key space.  Allocate the result in RESULT_POOL.
 */
Take the ORIGINAL string and replace all occurrences of ":" without
limiting the key space.  Allocate the result in RESULT_POOL.
Take the ORIGINAL string and replace all occurrences of " : " without limiting the key space . Allocate the result in RESULT_POOL .
static const char *
normalize_key_part(const char *original,
                   apr_pool_t *result_pool)
{
  apr_size_t i;
  apr_size_t len = strlen(original);
  svn_stringbuf_t *normalized = svn_stringbuf_create_ensure(len,
                                                            result_pool);
  for (i = 0; i < len; ++i)
    {
      char c = original[i];
      switch (c)
        {
        case ':': svn_stringbuf_appendbytes(normalized, "%_", 2);
                  break;
        case '%': svn_stringbuf_appendbytes(normalized, "%%", 2);
                  break;
        default : svn_stringbuf_appendbyte(normalized, c);
        }
    }
  return normalized->data;
}
static const char * normalize_key_part ( const char * original , apr_pool_t * result_pool ) { apr_size_t i ; apr_size_t len = strlen ( original ) ; svn_stringbuf_t * normalized = svn_stringbuf_create_ensure ( len , result_pool ) ; for ( i = 0 ; i < len ; ++ i ) { char c = original [ i ] ; switch ( c ) { case ' ' : svn_stringbuf_appendbytes ( normalized , " " , 2 ) ; break ; case ' ' : svn_stringbuf_appendbytes ( normalized , " " , 2 ) ; break ; default : svn_stringbuf_appendbyte ( normalized , c ) ; } } return normalized -> data ; }
Take the ORIGINAL string and replace all occurrences of ":" without
 limiting the key space.
Take the ORIGINAL string and replace all occurrences of " : " without limiting the key space .