Github messages for mblaze
 help / color / mirror / Atom feed
* [PR PATCH] seq: fix printing multiple mmsgs
@ 2020-08-11 12:00 jeremybobbin
  2020-08-11 12:01 ` [PR PATCH] [Updated] " jeremybobbin
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jeremybobbin @ 2020-08-11 12:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

There is a new pull request by jeremybobbin against master on the mblaze repository

https://github.com/jeremybobbin/mblaze master
https://github.com/leahneukirchen/mblaze/pull/181

seq: fix printing multiple mmsgs
According to `mseq(1)`, `mseq` should accept multiple *msgs*.

```
printf 'a\nb\n' | mseq -S
mseq 1 2
```

The above prints:
```
a
```

A patch file from https://github.com/leahneukirchen/mblaze/pull/181.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-181.patch --]
[-- Type: text/x-diff, Size: 1243 bytes --]

From f2db792d8384b8fc9c2e070ef2dc5bfaf8a36f3a Mon Sep 17 00:00:00 2001
From: Jeremy Bobbin <jer@jer.cx>
Date: Tue, 11 Aug 2020 04:50:51 -0700
Subject: [PATCH] seq: fix printing multiple mmsgs

printf 'a\nb\n' | mseq -S
mseq 1 2
---
 seq.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/seq.c b/seq.c
index 5d98284..58f3d17 100644
--- a/seq.c
+++ b/seq.c
@@ -427,17 +427,18 @@ blaze822_seq_next(char *map, char *range, struct blaze822_seq_iter *iter)
 	if (!iter->lines)  // count total lines
 		find_cur(map, iter);
 
-	if (!iter->s) {
-		int ret = parse_range(map, range, &iter->start, &iter->stop,
-		    iter->cur, iter->lines);
-		if (ret == 1) {
-			fprintf(stderr, "can't parse range: %s\n", range);
-			return 0;
-		} else if (ret == 2) {
-			fprintf(stderr, "message not found for specified range: %s\n", range);
-			return 0;
-		}
+	int ret = parse_range(map, range, &iter->start, &iter->stop,
+	    iter->cur, iter->lines);
 
+	if (ret == 1) {
+		fprintf(stderr, "can't parse range: %s\n", range);
+		return 0;
+	} else if (ret == 2) {
+		fprintf(stderr, "message not found for specified range: %s\n", range);
+		return 0;
+	}
+
+	if (!iter->s) {
 		iter->s = map;
 		iter->line = 1;
 	}

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-11 12:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11 12:00 [PR PATCH] seq: fix printing multiple mmsgs jeremybobbin
2020-08-11 12:01 ` [PR PATCH] [Updated] " jeremybobbin
2020-08-11 12:23 ` Duncaen
2020-08-11 12:32 ` [PR PATCH] [Updated] " jeremybobbin
2020-08-11 12:35 ` jeremybobbin
2020-08-11 12:41 ` [PR PATCH] [Closed]: " leahneukirchen
2020-08-11 12:41 ` leahneukirchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).