diff options
author | Jeremy Allison <jra@samba.org> | 2003-07-02 20:01:51 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-07-02 20:01:51 +0000 |
commit | af4d65889420eb3bb71be67d619dbc0c62e21101 (patch) | |
tree | 25dc0166e23606c72c4426d18aaa82744ef0b0f9 /source3/lib/util_str.c | |
parent | 93e995159f843e7f6acdbc33d1f329844e1a9973 (diff) | |
download | samba-af4d65889420eb3bb71be67d619dbc0c62e21101.tar.gz samba-af4d65889420eb3bb71be67d619dbc0c62e21101.tar.bz2 samba-af4d65889420eb3bb71be67d619dbc0c62e21101.zip |
Added fix for Japanese case names in statcache - these can change
size on upper casing. Based on patch from monyo@home.monyo.com.
Jeremy.
(This used to be commit 72e382e99b92666acdaf50a040b14aa16d48b80d)
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r-- | source3/lib/util_str.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index af8d6aa04c..ac8fccfa5a 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -1111,6 +1111,26 @@ char *strrchr_m(const char *s, char c) return (char *)(s+strlen(s2)); } +/*********************************************************************** + Return the equivalent of doing strrchr 'n' times - always going + backwards. +***********************************************************************/ + +char *strnrchr_m(const char *s, char c, unsigned int n) +{ + wpstring ws; + pstring s2; + smb_ucs2_t *p; + + push_ucs2(NULL, ws, s, sizeof(ws), STR_TERMINATE); + p = strnrchr_w(ws, UCS2_CHAR(c), n); + if (!p) + return NULL; + *p = 0; + pull_ucs2_pstring(s2, ws); + return (char *)(s+strlen(s2)); +} + /** Convert a string to lower case. **/ |