summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2006-02-20 02:14:00 +0000
committerPaul Smith <psmith@gnu.org>2006-02-20 02:14:00 +0000
commit6e0527913c6724fa92e2135de991e27df54c4289 (patch)
treec9e4c448ae4476e5ef81ca5a5ca8feb344e519c7 /job.c
parentbde826b18aeb6fd3c9de7a7733d1e163efde90e1 (diff)
downloadgunmake-6e0527913c6724fa92e2135de991e27df54c4289.tar.gz
- Memory cleanups, found with valgrind.
- Fix handling of special targets like .SUFFIX for VMS insensitive targets. - Don't make temporary batch files for -n. Make sure batch files are created in text mode.
Diffstat (limited to 'job.c')
-rw-r--r--job.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/job.c b/job.c
index 34f359d..3ef4c75 100644
--- a/job.c
+++ b/job.c
@@ -2770,6 +2770,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
/* Some shells do not work well when invoked as 'sh -c xxx' to run a
command line (e.g. Cygnus GNUWIN32 sh.exe on WIN32 systems). In these
cases, run commands via a script file. */
+ if (just_print_flag)
+ ; /* Do nothing here. */
if ((no_default_sh_exe || batch_mode_shell) && batch_filename_ptr) {
int temp_fd;
FILE* batch = NULL;
@@ -2784,8 +2786,9 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
*batch_filename_ptr));
/* Create a FILE object for the batch file, and write to it the
- commands to be executed. */
- batch = _fdopen (temp_fd, "w");
+ commands to be executed. Put the batch file in TEXT mode. */
+ _setmode (temp_fd, _O_TEXT);
+ batch = _fdopen (temp_fd, "wt");
if (!unixy_shell)
fputs ("@echo off\n", batch);
fputs (command_ptr, batch);