View | Details | Raw Unified | Return to issue 83940
Collapse All | Expand All

(-)dmake/function.c (-3 / +11 lines)
Lines 367-384 Link Here
367
	 Link_temp( Current_target, tmpfile, tmpname );
367
	 Link_temp( Current_target, tmpfile, tmpname );
368
368
369
	 /* Don't free tmpname if it is used. It is stored in a FILELIST
369
	 /* Don't free tmpname if it is used. It is stored in a FILELIST
370
	  * member in Link_temp(). */
370
	  * member in Link_temp() and freed by Unlink_temp_files(). */
371
      }
371
      }
372
      else
372
      else
373
	 FREE(tmpname);
373
	 FREE(tmpname);
374
   }
374
   }
375
375
376
   /* If file expanded to a non empty value tmpfile is already opened,
377
    * otherwise open it now. */
376
   if( !tmpfile )
378
   if( !tmpfile )
377
      tmpfile = Start_temp( "", Current_target, &tmpname );
379
      tmpfile = Start_temp( "", Current_target, &tmpname );
378
380
379
   /* If the text parameter is given return its expanded value
381
   /* If the text parameter is given return its expanded value
380
    * instead of the used filename. */
382
    * instead of the used filename. */
381
   if( !text || !*text ) text = tmpname;
383
   if( !text || !*text ) {
384
      /* tmpname is freed by Unlink_temp_files(). */
385
      text = DmStrDup(DO_WINPATH(tmpname));
386
   }
387
   else {
388
      text = Expand(text);
389
   }
382
390
383
   data = Expand(data);
391
   data = Expand(data);
384
392
Lines 386-392 Link Here
386
   Close_temp( Current_target, tmpfile );
394
   Close_temp( Current_target, tmpfile );
387
   FREE(data);
395
   FREE(data);
388
396
389
   return( Expand(text) );
397
   return( text );
390
}
398
}
391
399
392
400
(-)dmake/sysintf.c (-2 / +4 lines)
Lines 702-707 Link Here
702
702
703
   while( --tries )
703
   while( --tries )
704
   {
704
   {
705
      /* This sets path to the name of the created temp file. */
705
      if( (fd = Create_temp(tmpdir, path)) != -1)
706
      if( (fd = Create_temp(tmpdir, path)) != -1)
706
         break;
707
         break;
707
708
Lines 710-716 Link Here
710
711
711
   if( fd != -1)
712
   if( fd != -1)
712
   {
713
   {
713
      Def_macro( "TMPFILE", *path, M_MULTI|M_EXPANDED );
714
      Def_macro( "TMPFILE", DO_WINPATH(*path), M_MULTI|M_EXPANDED );
714
      /* associate stream with file descriptor */
715
      /* associate stream with file descriptor */
715
      fp = fdopen(fd, mode);
716
      fp = fdopen(fd, mode);
716
   }
717
   }
Lines 746-751 Link Here
746
747
747
   name = (cp != NIL(CELL))?cp->CE_NAME:"makefile text";
748
   name = (cp != NIL(CELL))?cp->CE_NAME:"makefile text";
748
749
750
   /* This sets tmpname to the name that was used. */
749
   if( (fp = Get_temp(&tmpname, "w")) == NIL(FILE) )
751
   if( (fp = Get_temp(&tmpname, "w")) == NIL(FILE) )
750
      Open_temp_error( tmpname, name );
752
      Open_temp_error( tmpname, name );
751
753
Lines 768-774 Link Here
768
      fname_suff = DmStrJoin( tmpname, suffix, -1, FALSE );
770
      fname_suff = DmStrJoin( tmpname, suffix, -1, FALSE );
769
771
770
      /* Overwrite macro, Get_temp didn't know of the suffix. */
772
      /* Overwrite macro, Get_temp didn't know of the suffix. */
771
      Def_macro( "TMPFILE", fname_suff, M_MULTI|M_EXPANDED );
773
      Def_macro( "TMPFILE", DO_WINPATH(fname_suff), M_MULTI|M_EXPANDED );
772
774
773
      if( (fp2 = fopen(fname_suff, "w" )) == NIL(FILE) )
775
      if( (fp2 = fopen(fname_suff, "w" )) == NIL(FILE) )
774
         Open_temp_error( fname_suff, name );
776
         Open_temp_error( fname_suff, name );
(-)dmake/man/dmake.tf (-2 / +3 lines)
Lines 719-726 Link Here
719
Under Cygwin it can be useful to generate Windows style paths (with
719
Under Cygwin it can be useful to generate Windows style paths (with
720
regular slashes) instead of the default cygwin style (POSIX) paths
720
regular slashes) instead of the default cygwin style (POSIX) paths
721
for dmake's dynamic macros.
721
for dmake's dynamic macros.
722
The affected macros are $@, $*, $>, $?, $<, $&, $^ and $(PWD), $(MAKEDIR)
722
The affected macros are $@, $*, $>, $?, $<, $&, $^ and $(MAKEDIR), $(PWD),
723
and $(TMD). This feature can be used to create DOS style path parameters
723
$(TMD), $(TMPFILE) and the $(mktmp ...) function macro.
724
This feature can be used to create DOS style path parameters
724
for native W32 programs from dynamic macros.
725
for native W32 programs from dynamic macros.
725
.sp
726
.sp
726
\fBNote\fP that the Windows style paths use regular slashes ('/') instead
727
\fBNote\fP that the Windows style paths use regular slashes ('/') instead

Return to issue 83940