--- deliantra/server/common/compat.C 2010/04/04 04:59:20 1.8 +++ deliantra/server/common/compat.C 2010/04/15 22:11:47 1.9 @@ -310,67 +310,12 @@ return (path); } -/** - * open_and_uncompress() first searches for the original filename. If it exist, - * then it opens it and returns the file-pointer. - */ -FILE * -open_and_uncompress (const char *name, int flag, int *compressed) -{ - *compressed = 0; - return fopen (name, "r"); -} - -/* - * See open_and_uncompress(). - */ - -void -close_and_delete (FILE * fp, int compressed) -{ - fclose (fp); -} - -/* - * Strip out the media tags from a String. - * Warning the input string will contain the result string - */ -void -strip_media_tag (char *message) -{ - int in_tag = 0; - char *dest; - char *src; - - src = dest = message; - while (*src != '\0') - { - if (*src == '[') - { - in_tag = 1; - } - else if (in_tag && (*src == ']')) - in_tag = 0; - else if (!in_tag) - { - *dest = *src; - dest++; - } - src++; - } - *dest = '\0'; -} - #define EOL_SIZE (sizeof("\n")-1) void strip_endline (char *buf) { - if (strlen (buf) < sizeof ("\n")) - { - return; - } - if (!strcmp (buf + strlen (buf) - EOL_SIZE, "\n")) - buf[strlen (buf) - EOL_SIZE] = '\0'; + if (*buf && buf [strlen (buf) - 1] == '\n') + buf [strlen (buf) - 1] = '\0'; } /**