/* The default preprocessor. */
-#define DEFAULT_PREPROCESSOR "gcc -E -xc -DRC_INVOKED"
+#define DEFAULT_PREPROCESSOR_CMD "gcc"
+#define DEFAULT_PREPROCESSOR_ARGS "-E -xc -DRC_INVOKED"
/* We read the directory entries in a cursor or icon file into
instances of this structure. */
look_for_default (char *cmd, const char *prefix, int end_prefix,
const char *preprocargs, const char *filename)
{
- char *space;
int found;
struct stat s;
const char *fnquotes = (filename_need_quotes (filename) ? "\"" : "");
strcpy (cmd, prefix);
- sprintf (cmd + end_prefix, "%s", DEFAULT_PREPROCESSOR);
- space = strchr (cmd + end_prefix, ' ');
- if (space)
- *space = 0;
+ sprintf (cmd + end_prefix, "%s", DEFAULT_PREPROCESSOR_CMD);
if (
#if defined (__DJGPP__) || defined (__CYGWIN__) || defined (_WIN32)
}
}
- strcpy (cmd, prefix);
+ if (filename_need_quotes (cmd))
+ {
+ char *cmd_copy = xmalloc (strlen (cmd));
+ strcpy (cmd_copy, cmd);
+ sprintf (cmd, "\"%s\"", cmd_copy);
+ free (cmd_copy);
+ }
- sprintf (cmd + end_prefix, "%s %s %s%s%s",
- DEFAULT_PREPROCESSOR, preprocargs, fnquotes, filename, fnquotes);
+ sprintf (cmd + strlen (cmd), " %s %s %s%s%s",
+ DEFAULT_PREPROCESSOR_ARGS, preprocargs, fnquotes, filename, fnquotes);
if (verbose)
fprintf (stderr, _("Using `%s'\n"), cmd);
{
char *dash, *slash, *cp;
- preprocessor = DEFAULT_PREPROCESSOR;
-
cmd = xmalloc (strlen (program_name)
- + strlen (preprocessor)
+ + strlen (DEFAULT_PREPROCESSOR_CMD)
+ + strlen (DEFAULT_PREPROCESSOR_ARGS)
+ strlen (preprocargs)
+ strlen (filename)
+ strlen (fnquotes) * 2