public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/1] tst_kvcmp: Fix parsing format for /etc/os-release
Date: Thu, 20 Aug 2020 13:05:50 +0200	[thread overview]
Message-ID: <20200820110550.GA20024@dell5510> (raw)
In-Reply-To: <20200820104623.GB9000@yuki.lan>

Hi Cyril, Po-Hsu,

> >  	if (access(OSRELEASE_PATH, F_OK) != -1) {
> > -		SAFE_FILE_LINES_SCANF(NULL, OSRELEASE_PATH, "ID=%s", distname);
> > +		SAFE_FILE_LINES_SCANF(NULL, OSRELEASE_PATH, "ID=\"%[^\"]\"",
> > +				      distname);

> I guess like opensuse is the only one that uses double quotes there.
> Does this actually work on, for example debian, that has ID=debian in
> the /etc/os-release?
No, sorry for overlooking that.

> I guess that it may be actually easier to optionaly strip the double
> quotes after the scanf().
+1, I'll send v2.

Kind regards,
Petr

      reply	other threads:[~2020-08-20 11:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 10:02 [LTP] [PATCH 1/1] tst_kvcmp: Fix parsing format for /etc/os-release Petr Vorel
2020-08-20 10:36 ` Po-Hsu Lin
2020-08-20 10:46 ` Cyril Hrubis
2020-08-20 11:05   ` Petr Vorel [this message]

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=20200820110550.GA20024@dell5510 \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /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