From 527726167a0c88127ecc92909fc828171d241ac2 Mon Sep 17 00:00:00 2001 From: keie Date: Thu, 13 Sep 1984 11:04:00 +0000 Subject: [PATCH] 1 - The outfile entry is only used when the output file must not be thrown away. 2 - If a combiner has no named input file (only libs+flags) then issue a warning message and make up a name. --- util/ack/files.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/util/ack/files.c b/util/ack/files.c index 3a64f15f4..8176e11a7 100644 --- a/util/ack/files.c +++ b/util/ack/files.c @@ -67,9 +67,10 @@ setfiles(phase) register trf *phase ; { in.p_keep=YES ; in.p_keeps=NO ; } - if ( phase->t_outfile ) { + if ( phase->t_outfile && phase->t_keep ) { out.p_path=phase->t_outfile ; out.p_keeps=NO ; + out.p_keep=YES ; } else { gr_init(&pathname) ; if ( !phase->t_keep && !t_flag ) { @@ -79,7 +80,15 @@ setfiles(phase) register trf *phase ; { gr_cat(&pathname,unique()) ; out.p_keep=NO ; } else { - gr_cat(&pathname,p_basename) ; + if ( !p_basename ) { + gr_cat(&pathname,"Ack") ; + gr_cat(&pathname,unique()) ; + p_basename=keeps(gr_start(pathname)) ; + werror("Output written on %s%s", + p_basename,phase->t_out) ; + } else { + gr_cat(&pathname,p_basename) ; + } out.p_keep=YES ; } gr_cat(&pathname,phase->t_out) ; @@ -167,8 +176,9 @@ add_input(file,phase) path *file ; trf *phase ; { file->p_path,phase->t_name) ; } #endif - if ( !l_first(phase->t_inputs) ) { - /* This becomes the first entry in the input list */ + phase->t_do=YES ; + if ( !phase->t_origname && orig.p_path[0]!='-' ) { + /* This entry decides the name of the result */ phase->t_origname= orig.p_path ; } store= (path *) getcore(sizeof (path)) ; -- 2.34.1