- char *t = strrchr (s, '.');
-
- if (t == (char *) 0)
- {
- return mstring_copy (s);
- }
-
- /*@-mods@*/
- *t = '\0';
- ret = mstring_copy (s);
- *t = '.';
- /*@=mods@*/ /* modification is undone */
-
- return ret;
-}
-
-/*@only@*/ char *
-addExtension (char *s, const char *suffix)
-{
- if (strrchr (s, '.') == (char *) 0)
- {
- /* <<< was mstring_concatFree1 --- bug detected by lclint >>> */
- return (mstring_concat (s, suffix));
- }
- else
- {
- return mstring_copy (s);
- }
-}
-
-int
-getInt (char **s)
-{
- bool gotOne = FALSE;
- int i = 0;
-
- while (**s == ' ')
- {
- (*s)++;
- }
-
- if (**s == '-')
- {
- (*s)++;
- if (**s < '0' || **s > '9')
- {
- llbug (message ("getInt: bad int: %s", cstring_fromChars (*s)));
- }
- else
- {
- i = -1 * (int) (**s - '0');
- gotOne = TRUE;
- }
-
- (*s)++;
- }
-
- while (**s >= '0' && **s <= '9')
- {
- i *= 10;
- i += (int) (**s - '0');
- (*s)++;
- gotOne = TRUE;
- }
-
- if (!gotOne)
- {
- llbug (message ("No int to read: %s", cstring_fromChars (*s)));
- }
-
- while (**s == '\n' || **s == ' ' || **s == '\t')
- {
- (*s)++;
- }