public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Aaron Merey via Gdb-patches <gdb-patches@sourceware.org>
Cc: Aaron Merey <amerey@redhat.com>,  pedro@palves.net
Subject: Re: [PATCH] gdb/debuginfod: Whitespace-only URL should disable debuginfod
Date: Thu, 28 Apr 2022 09:34:04 -0600	[thread overview]
Message-ID: <878rrpmdcj.fsf@tromey.com> (raw)
In-Reply-To: <20220427214653.311789-1-amerey@redhat.com> (Aaron Merey via Gdb-patches's message of "Wed, 27 Apr 2022 17:46:53 -0400")

>>>>> "Aaron" == Aaron Merey via Gdb-patches <gdb-patches@sourceware.org> writes:

Aaron> -  const char *urls = getenv (DEBUGINFOD_URLS_ENV_VAR);
Aaron> +  std::string urls = getenv (DEBUGINFOD_URLS_ENV_VAR) ?: "";

The ?: syntax is a GNU extension, not a standard feature.
 
Aaron> -  if (urls == nullptr || urls[0] == '\0'
Aaron> -      || debuginfod_enabled == debuginfod_off)
Aaron> +  if (debuginfod_enabled == debuginfod_off
Aaron> +      || urls.find_first_not_of (' ') == std::string::npos)
Aaron>      return false;

You could also just leave it as a const char * and use skip_spaces.
That would also skip tabs, which is probably desirable in some sense anyway.

Tom

  reply	other threads:[~2022-04-28 15:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 21:46 Aaron Merey
2022-04-28 15:34 ` Tom Tromey [this message]
2022-04-28 16:28 ` Pedro Alves
2022-04-28 22:37   ` Aaron Merey
2022-04-29 14:22     ` Pedro Alves
2022-04-29 19:49       ` Aaron Merey
2022-05-02 14:33         ` Pedro Alves
2022-05-02 20:16           ` Aaron Merey

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=878rrpmdcj.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=amerey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).