gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 8234f0de: Fits: --list* options now print HDU


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 8234f0de: Fits: --list* options now print HDU names in the input's order
Date: Tue, 25 Oct 2022 05:56:51 -0400 (EDT)

branch: master
commit 8234f0deb8ba51042d9094f2ee05bfe37b9beffe
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Fits: --list* options now print HDU names in the input's order
    
    Until now, the '--listimagehdus' or '--listtablehdus' options of the Fits
    program would print the HDUs in reverse order! This was because we were
    simply writing a last-in-first-out list (most efficient!) and finally
    printing it. But this is not what the user would expect.
    
    With this commit, the list is inversed after it has been found. This fits
    better with what a user would expect.
    
    This was noticed after a discussion with Michael Stein and Sepideh
    Eskandarlou.
---
 bin/fits/fits.c              | 3 +++
 doc/announce-acknowledge.txt | 1 +
 2 files changed, 4 insertions(+)

diff --git a/bin/fits/fits.c b/bin/fits/fits.c
index 3abe3d2e..a5158ab4 100644
--- a/bin/fits/fits.c
+++ b/bin/fits/fits.c
@@ -698,6 +698,9 @@ fits_certain_hdu(struct fitsparams *p, int list1has0,
   status=0;
   fits_close_file(fptr, &status);
 
+  /* Reverse the list so they are in the same order as they were found. */
+  gal_list_str_reverse(&names);
+
   /* Print the result. */
   if( list1has0 )
     {
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index b246ebef..52ec6350 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -1,6 +1,7 @@
 Alphabetically ordered list to acknowledge in the next release.
 
 Sepideh Eskandarlou
+Michael Stein
 
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]