int strcasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b);
int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len);
int strcmp_wa(const smb_ucs2_t *a, const char *b);
-int toupper_ascii(int c);
-int tolower_ascii(int c);
-int isupper_ascii(int c);
-int islower_ascii(int c);
/*
* Define stub for charset module which implements 8-bit encoding with gaps.
}
return (*(COPY_UCS2_CHAR(&cp,a)) - UCS2_CHAR(*b));
}
-
-/*************************************************************
- ascii only toupper - saves the need for smbd to be in C locale.
-*************************************************************/
-
-int toupper_ascii(int c)
-{
- smb_ucs2_t uc = toupper_m(UCS2_CHAR(c));
- return UCS2_TO_CHAR(uc);
-}
-
-/*************************************************************
- ascii only tolower - saves the need for smbd to be in C locale.
-*************************************************************/
-
-int tolower_ascii(int c)
-{
- smb_ucs2_t uc = tolower_m(UCS2_CHAR(c));
- return UCS2_TO_CHAR(uc);
-}
-
-/*************************************************************
- ascii only isupper - saves the need for smbd to be in C locale.
-*************************************************************/
-
-int isupper_ascii(int c)
-{
- return isupper_m(UCS2_CHAR(c));
-}
-
-/*************************************************************
- ascii only islower - saves the need for smbd to be in C locale.
-*************************************************************/
-
-int islower_ascii(int c)
-{
- return islower_m(UCS2_CHAR(c));
-}
psz1++;
while (isspace((int)*psz2))
psz2++;
- if (toupper_ascii((unsigned char)*psz1) != toupper_ascii((unsigned char)*psz2)
+ if (toupper_m((unsigned char)*psz1) != toupper_m((unsigned char)*psz2)
|| *psz1 == '\0'
|| *psz2 == '\0')
break;
for (i = offset; i < (len - (N - 1)); i++) {
char c = s[i];
- if (!islower_ascii(c))
+ if (!islower_m(c))
continue;
- s[i] = toupper_ascii(c);
+ s[i] = toupper_m(c);
nt_status = string_combinations2(s, i + 1, fn, N - 1,
private_data);
if (!NT_STATUS_EQUAL(nt_status, NT_STATUS_WRONG_PASSWORD)) {
{
char *s1_0=s1;
- while(*s1 && *s2 && (*s1 == *s2 || tolower_ascii(*s1) == tolower_ascii(*s2) ||
+ while(*s1 && *s2 && (*s1 == *s2 || tolower_m(*s1) == tolower_m(*s2) ||
(*s1 == '\\' && *s2=='/') || (*s1 == '/' && *s2=='\\'))) {
s1++; s2++;
}
for (i=offset;i<(len-(N-1));i++) {
char c = s[i];
- if (!islower_ascii((int)c))
+ if (!islower_m((int)c))
continue;
- s[i] = toupper_ascii(c);
+ s[i] = toupper_m(c);
ret = uname_string_combinations2(s, mem_ctx, i+1, fn, N-1);
if(ret)
return(ret);
(ie. they match for the first 128 chars) */
while (*s && !(((unsigned char)s[0]) & 0x80)) {
- *s = tolower_ascii((unsigned char)*s);
+ *s = tolower_m((unsigned char)*s);
s++;
}
if (len == 4 || len == 5) {
/* Don't use StrCaseCmp here as we don't want to
initialize iconv. */
- if ((toupper_ascii(pszParmValue[0]) == 'U') &&
- (toupper_ascii(pszParmValue[1]) == 'T') &&
- (toupper_ascii(pszParmValue[2]) == 'F')) {
+ if ((toupper_m(pszParmValue[0]) == 'U') &&
+ (toupper_m(pszParmValue[1]) == 'T') &&
+ (toupper_m(pszParmValue[2]) == 'F')) {
if (len == 4) {
if (pszParmValue[3] == '8') {
is_utf8 = true;
return false;
for (i = 0; i < 32; i += 2) {
- hinybble = toupper_ascii(p[i]);
- lonybble = toupper_ascii(p[i + 1]);
+ hinybble = toupper_m(p[i]);
+ lonybble = toupper_m(p[i + 1]);
p1 = strchr(hexchars, hinybble);
p2 = strchr(hexchars, lonybble);
}
for (i = 0; i < 42; i += 2) {
- hinybble = toupper_ascii(p[i]);
- lonybble = toupper_ascii(p[i + 1]);
+ hinybble = toupper_m(p[i]);
+ lonybble = toupper_m(p[i + 1]);
p1 = strchr(hexchars, hinybble);
p2 = strchr(hexchars, lonybble);
magic = strchr_m( s, magic_char );
while( magic && magic[1] && magic[2] ) { /* 3 chars, 1st is magic. */
if( ('.' == magic[3] || '/' == magic[3] || !(magic[3])) /* Ends with '.' or nul or '/' ? */
- && isbasechar( toupper_ascii(magic[1]) ) /* is 2nd char basechar? */
- && isbasechar( toupper_ascii(magic[2]) ) ) /* is 3rd char basechar? */
+ && isbasechar( toupper_m(magic[1]) ) /* is 2nd char basechar? */
+ && isbasechar( toupper_m(magic[2]) ) ) /* is 3rd char basechar? */
return( True ); /* If all above, then true, */
magic = strchr_m( magic+1, magic_char ); /* else seek next magic. */
}
s1 = strrchr( mangled_name_key, '.' );
if( s1 && (s2 = strrchr( raw_name, '.' )) ) {
size_t i = 1;
- while( s1[i] && (tolower_ascii( s1[i] ) == s2[i]) )
+ while( s1[i] && (tolower_m( s1[i] ) == s2[i]) )
i++;
if( !s1[i] && !s2[i] ) {
/* Truncate at the '.' */
char_flags[c2] |= FLAG_POSSIBLE2;
char_flags[c3] |= FLAG_POSSIBLE3;
char_flags[c4] |= FLAG_POSSIBLE4;
- char_flags[tolower_ascii(c1)] |= FLAG_POSSIBLE1;
- char_flags[tolower_ascii(c2)] |= FLAG_POSSIBLE2;
- char_flags[tolower_ascii(c3)] |= FLAG_POSSIBLE3;
- char_flags[tolower_ascii(c4)] |= FLAG_POSSIBLE4;
+ char_flags[tolower_m(c1)] |= FLAG_POSSIBLE1;
+ char_flags[tolower_m(c2)] |= FLAG_POSSIBLE2;
+ char_flags[tolower_m(c3)] |= FLAG_POSSIBLE3;
+ char_flags[tolower_m(c4)] |= FLAG_POSSIBLE4;
char_flags[(unsigned char)'.'] |= FLAG_POSSIBLE4;
}
if (! FLAG_CHECK(lead_chars[i], FLAG_ASCII)) {
lead_chars[i] = '_';
}
- lead_chars[i] = toupper_ascii(lead_chars[i]);
+ lead_chars[i] = toupper_m(lead_chars[i]);
}
for (;i<mangle_prefix;i++) {
lead_chars[i] = '_';
char c = dot_p[i];
if (FLAG_CHECK(c, FLAG_ASCII)) {
extension[extension_length++] =
- toupper_ascii(c);
+ toupper_m(c);
}
}
}
char *p = newstring;
while (*str) {
- if (*str != ' ') *p++ = toupper_ascii(*str);
+ if (*str != ' ') *p++ = toupper_m(*str);
++str;
}
*p = '\0';