Back to index

lightning-sunbird  0.9+nobinonly
Functions
unescape.c File Reference
#include "ldap-int.h"

Go to the source code of this file.

Functions

static int unhex (char c)
void nsldapi_hex_unescape (char *s)

Function Documentation

void nsldapi_hex_unescape ( char *  s)

Definition at line 50 of file unescape.c.

{
/*
 * Remove URL hex escapes from s... done in place.  The basic concept for
 * this routine is borrowed from the WWW library HTUnEscape() routine.
 */
       char   *p;

       for ( p = s; *s != '\0'; ++s ) {
              if ( *s == '%' ) {
                     if ( *++s != '\0' ) {
                            *p = unhex( *s ) << 4;
                     }
                     if ( *++s != '\0' ) {
                            *p++ += unhex( *s );
                     }
              } else {
                     *p++ = *s;
              }
       }

       *p = '\0';
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int unhex ( char  c) [static]

Definition at line 76 of file unescape.c.

{
       return( c >= '0' && c <= '9' ? c - '0'
           : c >= 'A' && c <= 'F' ? c - 'A' + 10
           : c - 'a' + 10 );
}

Here is the caller graph for this function: