make_punctation.c~

MudOSa4DGD/mudlib/dgd/sfun/make_punctation.c~ · 503 B

From the archive MudOSa4DGD-30.06.98.tar.gz

Download the archive   « Back to the archive contents

/*
 * make_punctation.c
 *
 * SFUN: End a sentece with a .
 *
 * (C) Frank Schmidt, Jesus@NorseMUD
 *
 */

/* get rid of "blablabla. ." */
#define STRIP_TRAILING_WHITESPACE


/* end a sentence with a puntuation */
static string make_punctation(string str) {
  int t;
  t = str[strlen(str)-1];

#ifdef STRIP_TRAILING_WHITESPACE
  while (t == ' ') {
    str = str[0..strlen(str)-2];
    t = str[strlen(str)-1];
  }
#endif

  if (t != '!' && t != '?' && t != '.')
    return "."; 
  else
    return "";
}

Site Stats

Snippets: 1791
Codebases: 571