From bf5e3d96f882fe51157059787cd658d4a7ddd840 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Mon, 30 Jan 2012 12:00:49 +0100 Subject: [PATCH] Bugfix: Removed -reverse switch from scan(1). No more to say but to quote MTR: -[no]reverse under #ifdef BERK (I really HATE this) And JLR: Lists messages in reverse order with the `-reverse' switch. This should be considered a bug. --- docs/COMPLETION-BASH | 2 +- docs/COMPLETION-ZSH | 2 +- man/mh-chart.man1 | 1 - man/scan.man1 | 11 ----------- uip/scan.c | 22 +++++----------------- 5 files changed, 7 insertions(+), 31 deletions(-) diff --git a/docs/COMPLETION-BASH b/docs/COMPLETION-BASH index 73f5efc..746f899 100644 --- a/docs/COMPLETION-BASH +++ b/docs/COMPLETION-BASH @@ -108,7 +108,7 @@ _nmh() ;; scan ) options=(-clear -noclear -form -format -header -noheader - -width -reverse -noreverse -file -version -help ) + -width -file -version -help ) ;; show ) options=(-draft -showproc -showmimeproc -header -noheader diff --git a/docs/COMPLETION-ZSH b/docs/COMPLETION-ZSH index 666f7e1..ae1e71f 100644 --- a/docs/COMPLETION-ZSH +++ b/docs/COMPLETION-ZSH @@ -149,7 +149,7 @@ compctl -K mhfseq -x 's[+][@]' \ rmmproc normmproc help)" -- refile compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \ - 's[-]' -k "(clear noclear form format header noheader reverse noreverse \ + 's[-]' -k "(clear noclear form format header noheader \ file help width)" - 'c[-1,-file]' -f - 'c[-1,-form]' -K mhfile -- scan compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \ diff --git a/man/mh-chart.man1 b/man/mh-chart.man1 index d4e5501..6a1caeb 100644 --- a/man/mh-chart.man1 +++ b/man/mh-chart.man1 @@ -593,7 +593,6 @@ all/to/cc/me] .IR string ] .RB [ \-width .IR columns ] -.RB [ \-reverse " | " \-noreverse ] .RB [ \-file .IR filename ] .RB [ \-version ] diff --git a/man/scan.man1 b/man/scan.man1 index 30021bc..ba59b45 100644 --- a/man/scan.man1 +++ b/man/scan.man1 @@ -17,7 +17,6 @@ scan \- produce a one line per message scan listing .IR string ] .RB [ \-width .IR columns ] -.RB [ \-reverse " | " \-noreverse ] .RB [ \-file .IR filename ] .RB [ \-version ] @@ -76,13 +75,6 @@ You should set the MM_CHARSET environment variable to your native character set, if it is not US-ASCII. See the mh-profile(5) man page for details about this environment variable. .PP -The switch -.BR \-reverse , -makes -.B scan -list the messages in reverse -order. -.PP The .B \-file .I filename @@ -92,9 +84,6 @@ listing of a maildrop file as produced by .BR packf . This listing includes every message in the file (you can't scan individual messages). -The switch -.B \-reverse -is ignored with this option. .PP The switch .B \-width diff --git a/uip/scan.c b/uip/scan.c index e5fb55a..a11ca0d 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -25,15 +25,11 @@ static struct swit switches[] = { { "format string", 5 }, #define WIDTHSW 4 { "width columns", 0 }, -#define REVSW 5 - { "reverse", 0 }, -#define NREVSW 6 - { "noreverse", 0 }, -#define FILESW 7 +#define FILESW 5 { "file file", 4 }, -#define VERSIONSW 8 +#define VERSIONSW 6 { "version", 0 }, -#define HELPSW 9 +#define HELPSW 7 { "help", 0 }, { NULL, 0 } }; @@ -49,7 +45,7 @@ int main(int argc, char **argv) { int clearflag = 0, ontty; - int width = 0, revflag = 0; + int width = 0; int i, state, msgnum; int seqnum[NUMATTRS], unseen, num_unseen_seq = 0; char *cp, *maildir, *file = NULL, *folder = NULL; @@ -117,12 +113,6 @@ main(int argc, char **argv) argp[-2]); width = atoi(cp); continue; - case REVSW: - revflag++; - continue; - case NREVSW: - revflag = 0; - continue; case FILESW: if (!(cp = *argp++) || (cp[0] == '-' && cp[1])) @@ -228,9 +218,7 @@ main(int argc, char **argv) ontty = isatty(fileno(stdout)); - for (msgnum = revflag ? mp->hghsel : mp->lowsel; - (revflag ? msgnum >= mp->lowsel : msgnum <= mp->hghsel); - msgnum += (revflag ? -1 : 1)) { + for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { if ((in = fopen(cp = m_name(msgnum), "r")) == NULL) { admonish(cp, "unable to open message"); -- 1.7.10.4