Github messages for mblaze
 help / color / mirror / Atom feed
From: jeremybobbin <jeremybobbin@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] seq: fix printing multiple mmsgs
Date: Tue, 11 Aug 2020 14:01:06 +0200	[thread overview]
Message-ID: <20200811120106.Ro6KykZANmUoFUXOdeivJ4nqehGvq2FggwZND8TgZIM@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-181@inbox.vuxu.org>

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

There is an updated 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: 1242 bytes --]

From baa5d4c3077a313e3b77392972774ad835ccc559 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 msgs

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;
 	}

  reply	other threads:[~2020-08-11 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 12:00 [PR PATCH] " jeremybobbin
2020-08-11 12:01 ` jeremybobbin [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200811120106.Ro6KykZANmUoFUXOdeivJ4nqehGvq2FggwZND8TgZIM@z \
    --to=jeremybobbin@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).