stripbraces(), s0 ==> s

This commit is contained in:
rlar 2017-11-16 22:13:09 +01:00
parent e4e408d656
commit 0101db946b
1 changed files with 5 additions and 5 deletions

View File

@ -93,16 +93,16 @@ stripbraces(SPICE_DSTRINGPTR dstr_p)
/* puts the funny placeholders. returns the number of {...} substitutions */ /* puts the funny placeholders. returns the number of {...} substitutions */
{ {
int n, i, nest; int n, i, nest;
char *s0; /* value of dynamic string */ char *s; /* value of dynamic string */
char *brace; char *brace;
SPICE_DSTRING tstr; /* temporary dynamic string */ SPICE_DSTRING tstr; /* temporary dynamic string */
n = 0; n = 0;
spice_dstring_init(&tstr); spice_dstring_init(&tstr);
s0 = spice_dstring_value(dstr_p); s = spice_dstring_value(dstr_p);
i = 0; i = 0;
while ((brace = strchr(s0 + i, '{')) != NULL) { while ((brace = strchr(s + i, '{')) != NULL) {
/* something to strip */ /* something to strip */
const char *j_ptr = brace + 1; const char *j_ptr = brace + 1;
@ -117,7 +117,7 @@ stripbraces(SPICE_DSTRINGPTR dstr_p)
j_ptr++; j_ptr++;
} }
pscopy(&tstr, s0, 0, (int) (brace - s0)); pscopy(&tstr, s, 0, (int) (brace - s));
if (brace[-1] > ' ') if (brace[-1] > ' ')
cadd(&tstr, ' '); cadd(&tstr, ' ');
@ -136,7 +136,7 @@ stripbraces(SPICE_DSTRINGPTR dstr_p)
int ilen = spice_dstring_length(&tstr); int ilen = spice_dstring_length(&tstr);
sadd(&tstr, j_ptr); sadd(&tstr, j_ptr);
scopyd(dstr_p, &tstr); scopyd(dstr_p, &tstr);
s0 = spice_dstring_value(dstr_p); s = spice_dstring_value(dstr_p);
i = ilen; i = ilen;
} }