diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-04-30 11:04:28 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-04-30 11:04:28 +0000 |
commit | 700f72453ed8dfd356a5591b9447127b5066ac4b (patch) | |
tree | 46a30958a2f160cf389a9309355c3ebc39c584fd /source3/lib/util_unistr.c | |
parent | 71e7974f3f847759ba6f844ea7f482786cc5db02 (diff) | |
download | samba-700f72453ed8dfd356a5591b9447127b5066ac4b.tar.gz samba-700f72453ed8dfd356a5591b9447127b5066ac4b.tar.bz2 samba-700f72453ed8dfd356a5591b9447127b5066ac4b.zip |
- removed all our old wildcard matching code and replaced it with a
call to ms_fnmatch(). This also removes all the Win9X semantics stuff
and a bunch of other associated cruft.
- moved the stat cache code into statcache.c
- fixed the uint16 alignment requirements of ascii_to_unistr() and
unistr_to_ascii()
- trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as
unicode always (at least thats what NT4 does)
- fixed some errors in the in-memory tdb code. Still ugly, but doesn't
crash as much
(This used to be commit 03e9cea004bbba72161a5323cf3b4556c94aed8e)
Diffstat (limited to 'source3/lib/util_unistr.c')
-rw-r--r-- | source3/lib/util_unistr.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index 71ef32a1fd..0ca148ba94 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -84,52 +84,45 @@ int dos_PutUniCode(char *dst,const char *src, ssize_t len, BOOL null_terminate) } /******************************************************************* - Put an ASCII string into a UNICODE array (uint16's). + Put an ASCII string into a UNICODE string. Warning: doesn't do any codepage !!! BAD !!! Help ! Fix Me ! Fix Me ! ********************************************************************/ -void ascii_to_unistr(uint16 *dest, const char *src, int maxlen) +void ascii_to_unistr(char *dest, const char *src, int maxlen) { - uint16 *destend = dest + maxlen; - register char c; + char *destend = dest + maxlen; + char c; - while (dest < destend) - { + while (dest < destend) { c = *(src++); - if (c == 0) - { - break; - } + if (c == 0) break; - *(dest++) = (uint16)c; + SSVAL(dest, 0, (uint16)c); + dest += 2; } - - *dest = 0; + SSVAL(dest, 0, 0); } /******************************************************************* - Pull an ASCII string out of a UNICODE array (uint16's). + Pull an ASCII string out of a UNICODE array . Warning: doesn't do any codepage !!! BAD !!! Help ! Fix Me ! Fix Me ! ********************************************************************/ -void unistr_to_ascii(char *dest, const uint16 *src, int len) +void unistr_to_ascii(char *dest, char *src, int len) { char *destend = dest + len; - register uint16 c; + uint16 c; - while (dest < destend) - { - c = *(src++); - if (c == 0) - { - break; - } + while (dest < destend) { + c = SVAL(src, 0); + src += 2; + if (c == 0) break; *(dest++) = (char)c; } |