Commit 96c6d457 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

hhctrl.ocx: Don't use strncasecmp.

parent 95510d5b
...@@ -595,7 +595,7 @@ WCHAR *GetDocumentTitle(CHMInfo *info, LPCWSTR document) ...@@ -595,7 +595,7 @@ WCHAR *GetDocumentTitle(CHMInfo *info, LPCWSTR document)
TRACE("%s\n", node.buf); TRACE("%s\n", node.buf);
if(!strcasecmp(node_name.buf, "title")) { if(!_strnicmp(node_name.buf, "title", -1)) {
if(next_content(&stream, &content) && content.len > 1) if(next_content(&stream, &content) && content.len > 1)
{ {
document_title = strdupnAtoW(&content.buf[1], content.len-1); document_title = strdupnAtoW(&content.buf[1], content.len-1);
......
...@@ -62,11 +62,11 @@ static void parse_obj_node_param(ContentItem *item, ContentItem *hhc_root, const ...@@ -62,11 +62,11 @@ static void parse_obj_node_param(ContentItem *item, ContentItem *hhc_root, const
return; return;
} }
if(!strncasecmp("name", ptr, len)) { if(!_strnicmp("name", ptr, len)) {
param = &item->name; param = &item->name;
}else if(!strncasecmp("merge", ptr, len)) { }else if(!_strnicmp("merge", ptr, len)) {
param = &merge; param = &merge;
}else if(!strncasecmp("local", ptr, len)) { }else if(!_strnicmp("local", ptr, len)) {
param = &item->local; param = &item->local;
}else { }else {
WARN("unhandled param %s\n", debugstr_an(ptr, len)); WARN("unhandled param %s\n", debugstr_an(ptr, len));
...@@ -148,9 +148,9 @@ static ContentItem *parse_sitemap_object(HHInfo *info, stream_t *stream, Content ...@@ -148,9 +148,9 @@ static ContentItem *parse_sitemap_object(HHInfo *info, stream_t *stream, Content
TRACE("%s\n", node.buf); TRACE("%s\n", node.buf);
if(!strcasecmp(node_name.buf, "/object")) if(!_strnicmp(node_name.buf, "/object", -1))
break; break;
if(!strcasecmp(node_name.buf, "param")) if(!_strnicmp(node_name.buf, "param", -1))
parse_obj_node_param(item, hhc_root, node.buf, info->pCHMInfo->codePage); parse_obj_node_param(item, hhc_root, node.buf, info->pCHMInfo->codePage);
strbuf_zero(&node); strbuf_zero(&node);
...@@ -195,7 +195,7 @@ static ContentItem *parse_ul(HHInfo *info, stream_t *stream, ContentItem *hhc_ro ...@@ -195,7 +195,7 @@ static ContentItem *parse_ul(HHInfo *info, stream_t *stream, ContentItem *hhc_ro
TRACE("%s\n", node.buf); TRACE("%s\n", node.buf);
if(!strcasecmp(node_name.buf, "object")) { if(!_strnicmp(node_name.buf, "object", -1)) {
const char *ptr; const char *ptr;
int len; int len;
...@@ -210,10 +210,10 @@ static ContentItem *parse_ul(HHInfo *info, stream_t *stream, ContentItem *hhc_ro ...@@ -210,10 +210,10 @@ static ContentItem *parse_ul(HHInfo *info, stream_t *stream, ContentItem *hhc_ro
if(!ret) if(!ret)
ret = prev; ret = prev;
} }
}else if(!strcasecmp(node_name.buf, "ul")) { }else if(!_strnicmp(node_name.buf, "ul", -1)) {
new_item = parse_ul(info, stream, hhc_root); new_item = parse_ul(info, stream, hhc_root);
insert_item(prev, new_item, INSERT_CHILD); insert_item(prev, new_item, INSERT_CHILD);
}else if(!strcasecmp(node_name.buf, "/ul")) { }else if(!_strnicmp(node_name.buf, "/ul", -1)) {
break; break;
} }
...@@ -245,7 +245,7 @@ static ContentItem *parse_hhc(HHInfo *info, IStream *str, ContentItem *hhc_root, ...@@ -245,7 +245,7 @@ static ContentItem *parse_hhc(HHInfo *info, IStream *str, ContentItem *hhc_root,
TRACE("%s\n", node.buf); TRACE("%s\n", node.buf);
if(!strcasecmp(node_name.buf, "ul")) { if(!_strnicmp(node_name.buf, "ul", -1)) {
ContentItem *item = parse_ul(info, &stream, hhc_root); ContentItem *item = parse_ul(info, &stream, hhc_root);
prev = insert_item(prev, item, INSERT_CHILD); prev = insert_item(prev, item, INSERT_CHILD);
if(!ret) if(!ret)
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winternl.h"
#include "winuser.h" #include "winuser.h"
#include "winnls.h" #include "winnls.h"
#include "htmlhelp.h" #include "htmlhelp.h"
......
...@@ -83,20 +83,20 @@ static void parse_index_obj_node_param(IndexItem *item, const char *text, UINT c ...@@ -83,20 +83,20 @@ static void parse_index_obj_node_param(IndexItem *item, const char *text, UINT c
/* Allocate a new sub-item, either on the first run or whenever a /* Allocate a new sub-item, either on the first run or whenever a
* sub-topic has filled out both the "name" and "local" params. * sub-topic has filled out both the "name" and "local" params.
*/ */
if(item->itemFlags == 0x11 && (!strncasecmp("name", ptr, len) || !strncasecmp("local", ptr, len))) if(item->itemFlags == 0x11 && (!_strnicmp("name", ptr, len) || !_strnicmp("local", ptr, len)))
item_realloc(item, item->nItems+1); item_realloc(item, item->nItems+1);
if(!strncasecmp("keyword", ptr, len)) { if(!_strnicmp("keyword", ptr, len)) {
param = &item->keyword; param = &item->keyword;
}else if(!item->keyword && !strncasecmp("name", ptr, len)) { }else if(!item->keyword && !_strnicmp("name", ptr, len)) {
/* Some HTML Help index files use an additional "name" parameter /* Some HTML Help index files use an additional "name" parameter
* rather than the "keyword" parameter. In this case, the first * rather than the "keyword" parameter. In this case, the first
* occurrence of the "name" parameter is the keyword. * occurrence of the "name" parameter is the keyword.
*/ */
param = &item->keyword; param = &item->keyword;
}else if(!strncasecmp("name", ptr, len)) { }else if(!_strnicmp("name", ptr, len)) {
item->itemFlags |= 0x01; item->itemFlags |= 0x01;
param = &item->items[item->nItems-1].name; param = &item->items[item->nItems-1].name;
}else if(!strncasecmp("local", ptr, len)) { }else if(!_strnicmp("local", ptr, len)) {
item->itemFlags |= 0x10; item->itemFlags |= 0x10;
param = &item->items[item->nItems-1].local; param = &item->items[item->nItems-1].local;
}else { }else {
...@@ -137,9 +137,9 @@ static IndexItem *parse_index_sitemap_object(HHInfo *info, stream_t *stream) ...@@ -137,9 +137,9 @@ static IndexItem *parse_index_sitemap_object(HHInfo *info, stream_t *stream)
TRACE("%s\n", node.buf); TRACE("%s\n", node.buf);
if(!strcasecmp(node_name.buf, "param")) { if(!_strnicmp(node_name.buf, "param", -1)) {
parse_index_obj_node_param(item, node.buf, info->pCHMInfo->codePage); parse_index_obj_node_param(item, node.buf, info->pCHMInfo->codePage);
}else if(!strcasecmp(node_name.buf, "/object")) { }else if(!_strnicmp(node_name.buf, "/object", -1)) {
break; break;
}else { }else {
WARN("Unhandled tag! %s\n", node_name.buf); WARN("Unhandled tag! %s\n", node_name.buf);
...@@ -173,7 +173,7 @@ static IndexItem *parse_li(HHInfo *info, stream_t *stream) ...@@ -173,7 +173,7 @@ static IndexItem *parse_li(HHInfo *info, stream_t *stream)
TRACE("%s\n", node.buf); TRACE("%s\n", node.buf);
if(!strcasecmp(node_name.buf, "object")) { if(!_strnicmp(node_name.buf, "object", -1)) {
const char *ptr; const char *ptr;
int len; int len;
...@@ -228,7 +228,7 @@ static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item) ...@@ -228,7 +228,7 @@ static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item)
TRACE("%s\n", node.buf); TRACE("%s\n", node.buf);
if(!strcasecmp(node_name.buf, "li")) { if(!_strnicmp(node_name.buf, "li", -1)) {
IndexItem *new_item; IndexItem *new_item;
new_item = parse_li(info, &stream); new_item = parse_li(info, &stream);
...@@ -246,9 +246,9 @@ static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item) ...@@ -246,9 +246,9 @@ static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item)
item = item->next; item = item->next;
item->indentLevel = indent_level; item->indentLevel = indent_level;
} }
}else if(!strcasecmp(node_name.buf, "ul")) { }else if(!_strnicmp(node_name.buf, "ul", -1)) {
indent_level++; indent_level++;
}else if(!strcasecmp(node_name.buf, "/ul")) { }else if(!_strnicmp(node_name.buf, "/ul", -1)) {
indent_level--; indent_level--;
}else { }else {
WARN("Unhandled tag! %s\n", node_name.buf); WARN("Unhandled tag! %s\n", node_name.buf);
......
...@@ -102,7 +102,7 @@ static WCHAR *SearchCHM_File(IStorage *pStorage, const WCHAR *file, const char * ...@@ -102,7 +102,7 @@ static WCHAR *SearchCHM_File(IStorage *pStorage, const WCHAR *file, const char *
char *text = &content.buf[1]; char *text = &content.buf[1];
int textlen = content.len-1; int textlen = content.len-1;
if(!strcasecmp(node_name.buf, "title")) if(!_strnicmp(node_name.buf, "title", -1))
{ {
int wlen = MultiByteToWideChar(CP_ACP, 0, text, textlen, NULL, 0); int wlen = MultiByteToWideChar(CP_ACP, 0, text, textlen, NULL, 0);
title = heap_alloc((wlen+1)*sizeof(WCHAR)); title = heap_alloc((wlen+1)*sizeof(WCHAR));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment