263 |
*/ |
*/ |
264 |
|
|
265 |
object |
object |
266 |
pathname_case_word(word, casekey) |
pathname_case_word(wrd, casekey) |
267 |
object word, casekey; |
object wrd, casekey; |
268 |
{ |
{ |
269 |
object x=word; |
object x=wrd; |
270 |
|
|
271 |
#ifdef ANSI_COMMON_LISP |
#ifdef ANSI_COMMON_LISP |
272 |
|
|
274 |
int seen_upper=0; |
int seen_upper=0; |
275 |
int i; |
int i; |
276 |
|
|
277 |
if (type_of(word) == t_string) { |
if (type_of(wrd) == t_string) { |
278 |
for (i=0; i<word->st.st_fillp; i++) { |
for (i=0; i<wrd->st.st_fillp; i++) { |
279 |
if (isupper(word->st.st_self[i])) seen_upper=1; |
if (isupper(wrd->st.st_self[i])) seen_upper=1; |
280 |
if (islower(word->st.st_self[i])) seen_lower=1; |
if (islower(wrd->st.st_self[i])) seen_lower=1; |
281 |
} |
} |
282 |
if (casekey == sKcommon) { |
if (casekey == sKcommon) { |
283 |
if (seen_lower != seen_upper) { |
if (seen_lower != seen_upper) { |
284 |
x=copy_simple_string(word); |
x=copy_simple_string(wrd); |
285 |
for (i=0; i<word->st.st_fillp; i++) { |
for (i=0; i<wrd->st.st_fillp; i++) { |
286 |
if (isupper(word->st.st_self[i])) |
if (isupper(wrd->st.st_self[i])) |
287 |
x->st.st_self[i]=tolower(x->st.st_self[i]); |
x->st.st_self[i]=tolower(x->st.st_self[i]); |
288 |
else |
else |
289 |
if (islower(word->st.st_self[i])) |
if (islower(wrd->st.st_self[i])) |
290 |
x->st.st_self[i]=toupper(x->st.st_self[i]); |
x->st.st_self[i]=toupper(x->st.st_self[i]); |
291 |
} |
} |
292 |
} |
} |
293 |
} else |
} else |
294 |
if (casekey == sKdowncase) { |
if (casekey == sKdowncase) { |
295 |
if ((seen_lower != seen_upper) || pathname_resolve(pathKansi)) |
if ((seen_lower != seen_upper) || pathname_resolve(pathKansi)) |
296 |
{ x=copy_simple_string(word); |
{ x=copy_simple_string(wrd); |
297 |
for (i=0; i<word->st.st_fillp; i++) |
for (i=0; i<wrd->st.st_fillp; i++) |
298 |
if (isupper(word->st.st_self[i])) |
if (isupper(wrd->st.st_self[i])) |
299 |
x->st.st_self[i]=tolower(x->st.st_self[i]); |
x->st.st_self[i]=tolower(x->st.st_self[i]); |
300 |
} |
} |
301 |
} |
} |