summaryrefslogtreecommitdiffstats
path: root/hack/hack.u_init.c
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>1993-04-20 21:27:31 +0000
committermycroft <mycroft@NetBSD.org>1993-04-20 21:27:31 +0000
commit398e51a3c905d11cf31c42e7bd5cce452bcd5534 (patch)
treee6054dce5f2a7fd92fd0410996e25db490b8c813 /hack/hack.u_init.c
parentfe0afaaa1fcf50d1e1278bebfb8aacf7277dea01 (diff)
downloadbsdgames-darwin-398e51a3c905d11cf31c42e7bd5cce452bcd5534.tar.gz
bsdgames-darwin-398e51a3c905d11cf31c42e7bd5cce452bcd5534.tar.zst
bsdgames-darwin-398e51a3c905d11cf31c42e7bd5cce452bcd5534.zip
Don't modify string constants.
Diffstat (limited to 'hack/hack.u_init.c')
-rw-r--r--hack/hack.u_init.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hack/hack.u_init.c b/hack/hack.u_init.c
index bc06fa5e..4d664a61 100644
--- a/hack/hack.u_init.c
+++ b/hack/hack.u_init.c
@@ -15,7 +15,7 @@ extern char plname[];
struct you zerou;
char pl_character[PL_CSIZ];
char *(roles[]) = { /* must all have distinct first letter */
- /* roles[4] may be changed to -man */
+ /* roles[4] may be changed to -woman */
"Tourist", "Speleologist", "Fighter", "Knight",
"Cave-man", "Wizard"
};
@@ -103,7 +103,7 @@ extern char readchar();
rolesyms[i] = 0;
if(pc = pl_character[0]) {
- if('a' <= pc && pc <= 'z') pc += 'A'-'a';
+ if(islower(pc)) pc = toupper(pc);
if((i = role_index(pc)) >= 0)
goto got_suffix; /* implies experienced */
printf("\nUnknown role: %c\n", pc);
@@ -136,7 +136,7 @@ extern char readchar();
printf("? [%s] ", rolesyms);
while(pc = readchar()) {
- if('a' <= pc && pc <= 'z') pc += 'A'-'a';
+ if(islower(pc)) pc = toupper(pc);
if((i = role_index(pc)) >= 0) {
printf("%c\n", pc); /* echo */
(void) fflush(stdout); /* should be seen */
@@ -164,9 +164,13 @@ beginner:
(void) putchar('\n');
(void) fflush(stdout);
}
+#if 0
+ /* Given the above code, I can't see why this would ever change
+ anything; it does core pretty well, though. - cmh 4/20/93 */
if(exper) {
roles[i][0] = pc;
}
+#endif
got_suffix: