Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp
Conflicts: doc/fixes35.0 include/extern.h include/ntconf.h include/obj.h include/patchlevel.h src/dig.c src/do.c src/files.c src/fountain.c src/mklev.c src/objnam.c src/options.c src/potion.c src/rumors.c src/save.c src/topten.c src/trap.c src/wield.c sys/share/pcmain.c sys/unix/unixmain.c sys/winnt/Makefile.msc util/lev_main.c util/makedefs.c
This commit is contained in:
@@ -26,6 +26,7 @@ NetHack, except that rounddiv may call panic().
|
||||
char chrcasecpy (int,int)
|
||||
char * strcasecpy (char *,const char *)
|
||||
char * s_suffix (const char *)
|
||||
char * ing_suffix (const char *)
|
||||
char * xcrypt (const char *, char *)
|
||||
boolean onlyspace (const char *)
|
||||
char * tabexpand (char *)
|
||||
@@ -235,6 +236,39 @@ s_suffix(s) /* return a name converted to possessive */
|
||||
return buf;
|
||||
}
|
||||
|
||||
char *
|
||||
ing_suffix(s)
|
||||
const char *s;
|
||||
{
|
||||
const char *vowel = "aeiouy";
|
||||
static char buf[BUFSZ];
|
||||
char onoff[10];
|
||||
char *p;
|
||||
Strcpy(buf, s);
|
||||
p = eos(buf);
|
||||
onoff[0] = *p = *(p+1) = '\0';
|
||||
if ((strlen(buf) > 4) &&
|
||||
(!strcmpi(p-3, " on") ||
|
||||
!strcmpi(p-4, " off") ||
|
||||
!strcmpi(p-5, " with"))) {
|
||||
p = strrchr(buf, ' ');
|
||||
Strcpy(onoff, p);
|
||||
}
|
||||
if (!index(vowel, *(p-1)) && index(vowel, *(p-2)) && !index(vowel, *(p-3))) {
|
||||
/* tip -> tipp + ing */
|
||||
*p = *(p-1);
|
||||
*(p+1) = '\0';
|
||||
} else if (!strcmpi(p-2, "ie")) { /* vie -> vy + ing */
|
||||
*(p-2) = 'y';
|
||||
*(p-1) = '\0';
|
||||
} else if (*(p-1) == 'e') /* grease -> greas + ing */
|
||||
*(p-1) = '\0';
|
||||
Strcat(buf, "ing");
|
||||
if (onoff[0]) Strcat(buf, onoff);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
xcrypt(str, buf) /* trivial text encryption routine (see makedefs) */
|
||||
const char *str;
|
||||
|
||||
Reference in New Issue
Block a user