+
+ case 'o':
+ {
+ char *p;
+
+ /* copy the file name into the buffer */
+ strcpy (buffer, getStringArg("-o", argv, &i, argc));
+ /* point to last character */
+ p = buffer + strlen (buffer) - 1;
+ if (*p == DIR_SEPARATOR_CHAR)
+ {
+ /* only output path specified */
+ dstPath = Safe_strdup (buffer);
+ fullDstFileName = NULL;
+ }
+ else
+ {
+ fullDstFileName = Safe_strdup (buffer);
+
+ /* get rid of the "."-extension */
+
+ /* is there a dot at all? */
+ if (strrchr (buffer, '.') &&
+ /* is the dot in the filename, not in the path? */
+ (strrchr (buffer, DIR_SEPARATOR_CHAR) < strrchr (buffer, '.')))
+ *strrchr (buffer, '.') = '\0';
+
+ dstFileName = Safe_strdup (buffer);
+
+ /* strip module name to get path */
+ p = strrchr (buffer, DIR_SEPARATOR_CHAR);
+ if (p)
+ {
+ /* path with trailing / */
+ p[1] = '\0';
+ dstPath = Safe_strdup (buffer);
+ }
+ }
+ break;
+ }