From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15177 invoked by alias); 26 Mar 2012 20:31:56 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 15143 invoked by uid 9079); 26 Mar 2012 20:31:55 -0000 Date: Mon, 26 Mar 2012 20:31:00 -0000 Message-ID: <20120326203155.15125.qmail@sourceware.org> 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. X-Git-Refname: refs/heads/archer-keiths-linespec-rewrite X-Git-Reftype: branch X-Git-Oldrev: 28fe301b9574630ddef65157e7c3993909f7c1b7 X-Git-Newrev: 63ef85dc45ff48ac0b216fac25786db84ec85eb1 X-SW-Source: 2012-q1/txt/msg00091.txt.bz2 List-Id: 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 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.