Changeset 256 for trunk/src/common.c


Ignore:
Timestamp:
06/15/11 18:05:37 (13 years ago)
Author:
tim
Message:

switched to %XX encoding in command line tool output

fixed limitation with NULL/None/(default) value name lookups

corrected an nttime bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/common.c

    r251 r256  
    2525iconv_t conv_desc;
    2626
    27 const char* key_special_chars = ",\"\\/";
    28 const char* subfield_special_chars = ",\"\\|";
    29 const char* common_special_chars = ",\"\\";
     27const char* key_special_chars = ",\"/";
     28const char* subfield_special_chars = ",\"|";
     29const char* common_special_chars = ",\"";
    3030
    3131#define REGLOOKUP_EXIT_OK       0
     
    7070/* Returns a newly malloc()ed string which contains original buffer,
    7171 * except for non-printable or special characters are quoted in hex
    72  * with the syntax '\xQQ' where QQ is the hex ascii value of the quoted
     72 * with the syntax '%QQ' where QQ is the hex ascii value of the quoted
    7373 * character.  A null terminator is added, since only ascii, not binary,
    7474 * is returned.
     
    119119    }
    120120   
    121     if(str[i] < 32 || str[i] > 126 || strchr(special, str[i]) != NULL)
     121    if(str[i] < 32 || str[i] > 126
     122       || str[i] == '%' || strchr(special, str[i]) != NULL)
    122123    {
    123124      num_written += snprintf(ret_val + num_written, buf_len - num_written,
    124                               "\\x%.2X", str[i]);
     125                              "%%%.2X", str[i]);
    125126    }
    126127    else
     
    135136/* Returns a newly malloc()ed string which contains original string,
    136137 * except for non-printable or special characters are quoted in hex
    137  * with the syntax '\xQQ' where QQ is the hex ascii value of the quoted
     138 * with the syntax '%QQ' where QQ is the hex ascii value of the quoted
    138139 * character.
    139140 */
Note: See TracChangeset for help on using the changeset viewer.