# HG changeset patch # User John W. Eaton # Date 1260428993 18000 # Node ID 59ed1155771579ca0c7ff18049cc472a46d3af88 # Parent f26a33e21db9794e865527a1d5bdf8acb8d3cbda mkoctfile: if output file is specified and it does not end in output_ext, append output_ext diff -r f26a33e21db9 -r 59ed11557715 ChangeLog --- a/ChangeLog Thu Dec 10 01:49:15 2009 -0500 +++ b/ChangeLog Thu Dec 10 02:09:53 2009 -0500 @@ -1,3 +1,8 @@ +2009-12-10 John W. Eaton + + * mkoctfile.in, mkoctfile.cc.in: If output file is specified and + it does not end in output_ext, append output_ext. + 2009-12-10 John W. Eaton * mkoctfile.in, mkoctfile.cc.in: When compiling files in diff -r f26a33e21db9 -r 59ed11557715 mkoctfile.cc.in --- a/mkoctfile.cc.in Thu Dec 10 01:49:15 2009 -0500 +++ b/mkoctfile.cc.in Thu Dec 10 02:09:53 2009 -0500 @@ -570,7 +570,13 @@ else { if (!outputfile.empty ()) - octfile = outputfile; + { + octfile = outputfile; + size_t len = octfile.length (); + size_t len_ext = output_ext.length (); + if (octfile.substr (len-len_ext) != output_ext) + octfile += output_ext; + } else octfile = basename (octfile, true) + output_ext; } diff -r f26a33e21db9 -r 59ed11557715 mkoctfile.in --- a/mkoctfile.in Thu Dec 10 01:49:15 2009 -0500 +++ b/mkoctfile.in Thu Dec 10 02:09:53 2009 -0500 @@ -350,6 +350,13 @@ else if [ -n "$outputfile" ]; then octfile="$outputfile" + case "$octfile" in + *$output_ext) + ;; + *) + octfile="$octfile$output_ext" + ;; + esac else octfile=`basename $octfile` octfile=`echo $octfile | $SED 's,\.[^.]*$,,'`$output_ext