public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: kseitz@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM] archer-keiths-linespec-rewrite: * linespec.c (TRIM_WHITESPACE): Remove. (copy_token_string): Use remove_trailing_whitespace.
Date: Mon, 26 Mar 2012 20:31:00 -0000 [thread overview]
Message-ID: <20120326203155.15125.qmail@sourceware.org> (raw)
The branch, archer-keiths-linespec-rewrite has been updated
via 63ef85dc45ff48ac0b216fac25786db84ec85eb1 (commit)
from 28fe301b9574630ddef65157e7c3993909f7c1b7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 63ef85dc45ff48ac0b216fac25786db84ec85eb1
Author: Keith Seitz <keiths@redhat.com>
Date: Mon Mar 26 13:29:24 2012 -0700
* linespec.c (TRIM_WHITESPACE): Remove.
(copy_token_string): Use remove_trailing_whitespace.
-----------------------------------------------------------------------
Summary of changes:
gdb/linespec.c | 19 ++++---------------
1 files changed, 4 insertions(+), 15 deletions(-)
First 500 lines of diff:
diff --git a/gdb/linespec.c b/gdb/linespec.c
index a94499b..50cf2e0 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -333,19 +333,6 @@ static const char *const linespec_quote_characters = "\"\'";
/* Lexer functions. */
-/* A convenience macro for trimming trailing whitespace
- from string P. */
-
-#define TRIM_WHITESPACE(P) \
- do \
- { \
- char *_p = (P) + strlen ((P)) - 1; \
- while (_p >= (P) && (*_p == ' ' || *_p == '\t')) \
- _p--; \
- *(_p + 1) = '\0'; \
- } \
- while (0)
-
/* Lex a number from the input in PARSER. This only supports
decimal numbers. */
@@ -442,14 +429,16 @@ skip_quote_char (const char *string, char quote_char)
static char *
copy_token_string (linespec_token token)
{
- char *str;
+ char *str, *s;
if (token.type == LSTOKEN_KEYWORD)
return xstrdup (LS_TOKEN_KEYWORD (token));
str = savestring (LS_TOKEN_STOKEN (token).ptr,
LS_TOKEN_STOKEN (token).length);
- TRIM_WHITESPACE (str);
+ s = remove_trailing_whitespace (str, str + LS_TOKEN_STOKEN (token).length);
+ *s = '\0';
+
return str;
}
hooks/post-receive
--
Repository for Project Archer.
reply other threads:[~2012-03-26 20:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20120326203155.15125.qmail@sourceware.org \
--to=kseitz@sourceware.org \
--cc=archer-commits@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).