From 080f7a428bb5f20fc806bc3dde7055da513d1d5e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 18 Feb 2011 19:28:03 +0000 Subject: [PATCH] constify the line string given to urj_parse_line git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1876 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 3 +++ urjtag/include/urjtag/parse.h | 2 +- urjtag/src/global/parse.c | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index da62d4f3..fa719ceb 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -4,6 +4,9 @@ * include/urjtag/parse.h: Document the various stream functions. + * include/urjtag/parse.h (urj_parse_line): Constify the "line" argument. + * src/global/parse.c (urj_parse_line): Likewise. + 2011-02-17 Mike Frysinger * data/analog/bf548/STEPPINGS: Add bf54x-0.4 support. diff --git a/urjtag/include/urjtag/parse.h b/urjtag/include/urjtag/parse.h index 3b5bb88e..141a882b 100644 --- a/urjtag/include/urjtag/parse.h +++ b/urjtag/include/urjtag/parse.h @@ -37,7 +37,7 @@ * URJ_STATUS_ERROR on error * URJ_STATUS_QUIT on quit command */ -int urj_parse_line (urj_chain_t *chain, char *line); +int urj_parse_line (urj_chain_t *chain, const char *line); /** * Run each line in the specified stream through urj_parse_line(). diff --git a/urjtag/src/global/parse.c b/urjtag/src/global/parse.c index 387eabfa..6d84cfb6 100644 --- a/urjtag/src/global/parse.c +++ b/urjtag/src/global/parse.c @@ -45,12 +45,13 @@ int -urj_parse_line (urj_chain_t *chain, char *line) +urj_parse_line (urj_chain_t *chain, const char *line) { int l, i, r, tcnt; int escape = 0, quote_single = 0, quote_double = 0; char **a; - char *c, *d; + const char *c; + char *d; char *sline; if (line == NULL)