-+ if (len > 32)
-+ {
-+ fprintf (stderr, "authmysql: variable name too long "
-+ "while parsing substitution\n"
-+ "authmysql: name begins with "
-+ SV_BEGIN_MARK
-+ "%.*s...\n", 32, begin);
-+ return -1;
-+ }
-+
-+ for (vdp=vd; vdp->name; vdp++)
-+ if (vdp->size == len+1 &&
-+ !strncmp(begin, vdp->name, len))
-+ return 0;
-+
-+ fprintf (stderr, "authmysql: unknown substitution variable "
-+ SV_BEGIN_MARK
-+ "%.*s"
-+ SV_END_MARK
-+ "\n", len, begin);
-+ return -1;
-+}
-+
-+/* siefca@pld.org.pl */
-+size_t ParsePlugin_value_len (const char *begin, size_t len,
-+ struct var_data *vd)
-+{
-+struct var_data *vdp;
-+
-+ for (vdp=vd; vdp->name; vdp++)
-+ if (vdp->size == len+1 &&
-+ !strncmp(begin, vdp->name, len))
-+ {
-+ if (!vdp->value) /* should never happend */
-+ return 0;
-+ if (!vdp->value_length) /* length cache */
-+ vdp->value_length = strlen (vdp->value);
-+ return (vdp->value_length);
-+ }
++ /* work on last part of text if any */
++ if (*q != '\0')
++ if ( (outfn (q, strlen(q), result)) == -1 )
++ return -1;