Ignore:
Timestamp:
Nov 12, 2012, 7:10:02 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: update branche to 3.5.18

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.5.x/source4/lib/ldb/common/ldb_parse.c

    r414 r738  
    9090}
    9191
     92static bool need_encode(unsigned char cval)
     93{
     94        if (cval < 0x20 || cval > 0x7E || strchr(" *()\\&|!\"", cval)) {
     95                return true;
     96        }
     97        return false;
     98}
    9299
    93100/*
     
    103110
    104111        for (i=0;i<val.length;i++) {
    105                 if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) {
     112                if (need_encode(buf[i])) {
    106113                        len += 2;
    107114                }
     
    112119        len = 0;
    113120        for (i=0;i<val.length;i++) {
    114                 if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) {
     121                if (need_encode(buf[i])) {
    115122                        snprintf(ret+len, 4, "\\%02X", buf[i]);
    116123                        len += 3;
Note: See TracChangeset for help on using the changeset viewer.