#ifndef STDOUT_FILENO
#define STDOUT_FILENO 1
#endif
-
+
#if defined (_WIN32) && ! defined (__CYGWIN__)
#define popen _popen
#define pclose _pclose
/* Count the args. */
i = 0;
-
+
for (s = cmd; *s; s++)
if (*s == ' ')
i++;
-
+
i++;
argv = alloca (sizeof (char *) * (i + 3));
i = 0;
s = cmd;
-
+
while (1)
{
while (*s == ' ' && *s != 0)
s++;
-
+
if (*s == 0)
break;
-
+
in_quote = (*s == '\'' || *s == '"');
sep = (in_quote) ? *s++ : ' ';
argv[i++] = s;
-
+
while (*s != sep && *s != 0)
s++;
-
+
if (*s == 0)
break;
-
+
*s++ = 0;
-
+
if (in_quote)
- s++;
+ s++;
}
argv[i++] = NULL;
/* Open temporary output file. */
redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, 0666);
if (redir_handle == -1)
- fatal (_("can't open temporary file `%s': %s"), redir,
- strerror (errno));
+ fatal (_("can't open temporary file `%s': %s"), redir,
+ strerror (errno));
/* Duplicate the stdout file handle so it can be restored later. */
stdout_save = dup (STDOUT_FILENO);
retcode = 0;
pid = pwait (pid, &wait_status, 0);
-
+
if (pid == -1)
{
fatal (_("wait: %s"), strerror (errno));
{
if (WEXITSTATUS (wait_status) != 0)
{
- fatal (_("%s exited with status %d"), cmd,
+ fatal (_("%s exited with status %d"), cmd,
WEXITSTATUS (wait_status));
retcode = 1;
}
}
else
retcode = 1;
-
+
return retcode;
}
cpp_pipe = fopen (cpp_temp_file, FOPEN_RT);;
if (cpp_pipe == NULL)
- fatal (_("can't open temporary file `%s': %s"),
+ fatal (_("can't open temporary file `%s': %s"),
cpp_temp_file, strerror (errno));
-
+
if (verbose)
- fprintf (stderr,
+ fprintf (stderr,
_("Using temporary file `%s' to read preprocessor output\n"),
cpp_temp_file);
}
{
cpp_pipe = popen (cmd, FOPEN_RT);
if (cpp_pipe == NULL)
- fatal (_("can't popen `%s': %s"), cmd, strerror (errno));
+ fatal (_("can't popen `%s': %s"), cmd, strerror (errno));
if (verbose)
fprintf (stderr, _("Using popen to read preprocessor output\n"));
}
}
}
-
+
free (cmd);
rc_filename = xstrdup (filename);
rcparse_set_language (language);
yyin = cpp_pipe;
yyparse ();
+ rcparse_discard_strings ();
close_input_stream ();
-
+
if (fontdirs != NULL)
define_fontdirs ();
if (cpp_temp_file != NULL)
{
int errno_save = errno;
-
+
unlink (cpp_temp_file);
errno = errno_save;
free (cpp_temp_file);
&& (re->id.u.id & 0xffff) == re->id.u.id)
{
fprintf (e, "LANGUAGE %lu, %lu\n",
- re->id.u.id & ((1 << SUBLANG_SHIFT) - 1),
+ re->id.u.id & ((1 << SUBLANG_SHIFT) - 1),
(re->id.u.id >> SUBLANG_SHIFT) & 0xff);
*language = re->id.u.id;
}
fprintf (e, "// Level %d: ", level);
res_id_print (e, re->id, 1);
fprintf (e, "\n");
- }
+ }
write_rc_directory (e, re->u.dir, type, name, language, level + 1);
}
unicode_print (e, dialog->font, -1);
fprintf (e, "\"");
if (dialog->ex != NULL
- && (dialog->ex->weight != 0 || dialog->ex->italic != 0))
- fprintf (e, ", %d, %d", dialog->ex->weight, dialog->ex->italic);
+ && (dialog->ex->weight != 0
+ || dialog->ex->italic != 0
+ || dialog->ex->charset != 1))
+ fprintf (e, ", %d, %d, %d",
+ dialog->ex->weight, dialog->ex->italic, dialog->ex->charset);
fprintf (e, "\n");
}
fprintf (e, "%s", ci->name);
else
fprintf (e, "CONTROL");
-
+
if (control->text.named || control->text.u.id != 0)
{
fprintf (e, " ");