public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-keiths-linespec-rewrite: * linespec.c (TRIM_WHITESPACE): Remove. (copy_token_string): Use remove_trailing_whitespace.
@ 2012-03-26 20:31 kseitz
0 siblings, 0 replies; only message in thread
From: kseitz @ 2012-03-26 20:31 UTC (permalink / raw)
To: archer-commits
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-03-26 20:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-26 20:31 [SCM] archer-keiths-linespec-rewrite: * linespec.c (TRIM_WHITESPACE): Remove. (copy_token_string): Use remove_trailing_whitespace kseitz
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).