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/source3/lib/ldb/common/ldb_parse.c

    r414 r738  
    9393}
    9494
     95static bool need_encode(unsigned char cval)
     96{
     97        if (cval < 0x20 || cval > 0x7E || strchr(" *()\\&|!\"", cval)) {
     98                return true;
     99        }
     100        return false;
     101}
    95102
    96103/*
     
    106113
    107114        for (i=0;i<val.length;i++) {
    108                 if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) {
     115                if (need_encode(buf[i])) {
    109116                        len += 2;
    110117                }
     
    115122        len = 0;
    116123        for (i=0;i<val.length;i++) {
    117                 if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) {
     124                if (need_encode(buf[i])) {
    118125                        snprintf(ret+len, 4, "\\%02X", buf[i]);
    119126                        len += 3;
Note: See TracChangeset for help on using the changeset viewer.