Ignore:
Timestamp:
Nov 29, 2012, 1:59:04 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/lib/ldb_compat.c

    r745 r751  
    8585}
    8686
    87 
    88 
     87static bool need_encode(unsigned char cval)
     88{
     89        if (cval < 0x20 || cval > 0x7E || strchr(" *()\\&|!\"", cval)) {
     90                return true;
     91        }
     92        return false;
     93}
    8994
    9095/*
     
    100105
    101106        for (i=0;i<val.length;i++) {
    102                 if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) {
     107                if (need_encode(buf[i])) {
    103108                        len += 2;
    104109                }
     
    109114        len = 0;
    110115        for (i=0;i<val.length;i++) {
    111                 if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) {
     116                if (need_encode(buf[i])) {
    112117                        snprintf(ret+len, 4, "\\%02X", buf[i]);
    113118                        len += 3;
Note: See TracChangeset for help on using the changeset viewer.