Print this page
make: use the more modern wchar routines, not widec.h
*** 1486,1519 ****
}
/* If dependency name string contains shell wildcards */
/* replace the name with the expansion */
if (dependency->name->wildcard) {
wcb.init(dependency->name);
! if ((start = (wchar_t *) wschr(wcb.get_string(),
(int) parenleft_char)) != NULL) {
/* lib(*) type pattern */
library = buffer;
! (void) wsncpy(buffer,
wcb.get_string(),
start - wcb.get_string());
buffer[start-wcb.get_string()] =
(int) nul_char;
! (void) wsncpy(pattern,
start + 1,
(int) (dependency->name->hash.length-(start-wcb.get_string())-2));
pattern[dependency->name->hash.length -
(start-wcb.get_string()) - 2] =
(int) nul_char;
} else {
library = NULL;
! (void) wsncpy(pattern,
wcb.get_string(),
(int) dependency->name->hash.length);
pattern[dependency->name->hash.length] =
(int) nul_char;
}
! start = (wchar_t *) wsrchr(pattern, (int) slash_char);
if (start == NULL) {
directory = dot;
p = pattern;
} else {
directory = GETNAME(pattern, start-pattern);
--- 1486,1519 ----
}
/* If dependency name string contains shell wildcards */
/* replace the name with the expansion */
if (dependency->name->wildcard) {
wcb.init(dependency->name);
! if ((start = (wchar_t *) wcschr(wcb.get_string(),
(int) parenleft_char)) != NULL) {
/* lib(*) type pattern */
library = buffer;
! (void) wcsncpy(buffer,
wcb.get_string(),
start - wcb.get_string());
buffer[start-wcb.get_string()] =
(int) nul_char;
! (void) wcsncpy(pattern,
start + 1,
(int) (dependency->name->hash.length-(start-wcb.get_string())-2));
pattern[dependency->name->hash.length -
(start-wcb.get_string()) - 2] =
(int) nul_char;
} else {
library = NULL;
! (void) wcsncpy(pattern,
wcb.get_string(),
(int) dependency->name->hash.length);
pattern[dependency->name->hash.length] =
(int) nul_char;
}
! start = (wchar_t *) wcsrchr(pattern, (int) slash_char);
if (start == NULL) {
directory = dot;
p = pattern;
} else {
directory = GETNAME(pattern, start-pattern);
*** 2698,2708 ****
/* Use the value to build the proper filename. */
INIT_STRING_FROM_STACK(string, name);
Wstring wcb(target);
if ((link[0] != slash_char) &&
! ((p = (wchar_t *) wsrchr(wcb.get_string(), slash_char)) != NULL)) {
append_string(wcb.get_string(), &string, p - wcb.get_string() + 1);
}
append_string(link, &string, result);
/* Replace the old name with the translated name. */
target = normalize_name(string.buffer.start, string.text.p - string.buffer.start);
--- 2698,2708 ----
/* Use the value to build the proper filename. */
INIT_STRING_FROM_STACK(string, name);
Wstring wcb(target);
if ((link[0] != slash_char) &&
! ((p = (wchar_t *) wcsrchr(wcb.get_string(), slash_char)) != NULL)) {
append_string(wcb.get_string(), &string, p - wcb.get_string() + 1);
}
append_string(link, &string, result);
/* Replace the old name with the translated name. */
target = normalize_name(string.buffer.start, string.text.p - string.buffer.start);
*** 2816,2826 ****
wchar_t * wcb = file_string.get_string();
wchar_t usr_include_buf[MAXPATHLEN];
wchar_t usr_include_sys_buf[MAXPATHLEN];
register Name directory = dot;
! register wchar_t *p = (wchar_t *) wsrchr(wcb,
(int) slash_char);
register int length = p - wcb;
static Name usr_include;
static Name usr_include_sys;
--- 2816,2826 ----
wchar_t * wcb = file_string.get_string();
wchar_t usr_include_buf[MAXPATHLEN];
wchar_t usr_include_sys_buf[MAXPATHLEN];
register Name directory = dot;
! register wchar_t *p = (wchar_t *) wcsrchr(wcb,
(int) slash_char);
register int length = p - wcb;
static Name usr_include;
static Name usr_include_sys;
*** 2890,2902 ****
conditional != NULL;
conditional = get_prop(conditional->next, conditional_prop)) {
wcb1.init(conditional->body.conditional.target);
pattern = wcb1.get_string();
if (pattern[1] != 0) {
! percent = (wchar_t *) wschr(pattern, (int) percent_char);
if (!wcb.equaln(pattern, percent-pattern) ||
! !IS_WEQUAL(wcb.get_string(wcb.length()-wslen(percent+1)), percent+1)) {
continue;
}
}
for (previous = &target->prop;
*previous != NULL;
--- 2890,2902 ----
conditional != NULL;
conditional = get_prop(conditional->next, conditional_prop)) {
wcb1.init(conditional->body.conditional.target);
pattern = wcb1.get_string();
if (pattern[1] != 0) {
! percent = (wchar_t *) wcschr(pattern, (int) percent_char);
if (!wcb.equaln(pattern, percent-pattern) ||
! !IS_WEQUAL(wcb.get_string(wcb.length()-wcslen(percent+1)), percent+1)) {
continue;
}
}
for (previous = &target->prop;
*previous != NULL;