}
int
-get_any_string (idx, in, out)
+get_any_string (idx, in, out, expand)
int idx;
sb *in;
sb *out;
+ int expand;
{
sb_reset (out);
idx = sb_skip_white (idx, in);
if (idx < in->len)
{
if (in->ptr[idx] == '%'
- && alternate)
+ && alternate
+ && expand)
{
int val;
char buf[20];
idx + 1,
in,
&val);
- sprintf(buf, "\"%d\"", val);
+ sprintf(buf, "%d", val);
sb_add_string (out, buf);
}
else if (in->ptr[idx] == '"'
|| in->ptr[idx] == '<'
|| (alternate && in->ptr[idx] == '\''))
{
- if (alternate)
+ if (alternate && !expand)
{
/* Keep the quotes */
- sb_add_char (out, '\"');
+/* sb_add_char (out, '\"');*/
idx = getstring (idx, in, out);
- sb_add_char (out, '\"');
+/* sb_add_char (out, '\"');*/
}
else {
{
sb t;
sb_new (&t);
- idx = get_any_string (idx, in, &t);
+ idx = get_any_string (idx, in, &t, 1);
process_assigns (0, &t, out);
sb_kill (&t);
return idx;
if (idx < in->len && in->ptr[idx] == '=')
{
/* Got a default */
- idx = get_any_string (idx + 1, in, &formal->def);
+ idx = get_any_string (idx + 1, in, &formal->def, 1);
}
}
sb_add_char (name, in->ptr[idx++]);
}
}
+ /* Ignore trailing & */
+ if (alternate && idx < in->len && in->ptr[idx] == '&')
+ idx++;
return idx;
}
scan = idx;
while (scan < in->len
&& !ISSEP (in->ptr[scan])
- && in->ptr[scan] != '=')
+ && (!alternate && in->ptr[scan] != '='))
scan++;
- if (scan < in->len && in->ptr[scan] == '=')
+ if (scan < in->len && (!alternate) && in->ptr[scan] == '=')
{
is_keyword = 1;
if (is_positional)
{
/* Insert this value into the right place */
sb_reset (&ptr->value.f->actual);
- idx = get_any_string (idx + 1, in, &ptr->value.f->actual);
+ idx = get_any_string (idx + 1, in, &ptr->value.f->actual, 0);
}
}
else
}
sb_reset (&f->actual);
- idx = get_any_string (idx, in, &f->actual);
+ idx = get_any_string (idx, in, &f->actual, 1);
f = f->next;
}
idx = sb_skip_comma (idx, in);
idx = sb_skip_white (idx, in);
while (!eol (idx, in))
{
- pidx = idx = get_any_string (idx, in, &acc);
+ pidx = idx = get_any_string (idx, in, &acc, 1);
if (type == 'c')
{
if (acc.len > 255)