-const char *
-skeleton_find (const char *envvar, const char *skeleton_name)
-{
- const char *res = getenv (envvar);
-
-#ifdef MSDOS
- const char *cp;
-
- /* File doesn't exist in current directory; try in INIT directory. */
- if (!res && (cp = getenv ("INIT")))
- {
- res = XMALLOC (char, strlen (cp) + strlen (skeleton_name) + 2);
- sprintf (res, "%s%c%s", cp, '/', skeleton_name);
- }
-#endif /* !MSDOS */
-
- if (!res)
- res = skeleton_name;
-
- return res;
-}
-\f
-
-/*----------------------------------------------------------------.
-| Compute BASE_NAME, SHORT_BASE_NAME and output files extensions. |
-`----------------------------------------------------------------*/
-
-/* Replace all characters FROM by TO in the string IN.
- and returns a new allocated string. */
-static char *
-tr (const char *in, char from, char to)
-{
- char *temp;
- char *out;
-
- out = XMALLOC (char, strlen (in) + 1);
-
- for (temp = out; *in; in++, out++)
- if (*in == from)
- *out = to;
- else
- *out = *in;
- *out = 0;
- return (temp);
-}
-
-/* Gets the extension index in FILENAME. Returns 0 if fails to
- find an extension. */
-static int
-get_extension_index (const char *filename)
+/* In the string S, replace all characters FROM by TO. */
+static void
+tr (char *s, char from, char to)