[svn] GnuPG - r4592 - trunk/tools
svn author wk
cvs at cvs.gnupg.org
Fri Oct 12 18:05:22 CEST 2007
Author: wk
Date: 2007-10-12 18:05:14 +0200 (Fri, 12 Oct 2007)
New Revision: 4592
Modified:
trunk/tools/ChangeLog
trunk/tools/gpg-connect-agent.c
Log:
Allow ${foo} syntax for variables.
Modified: trunk/tools/ChangeLog
===================================================================
--- trunk/tools/ChangeLog 2007-10-11 18:18:24 UTC (rev 4591)
+++ trunk/tools/ChangeLog 2007-10-12 16:05:14 UTC (rev 4592)
@@ -1,3 +1,7 @@
+2007-10-12 Werner Koch <wk at g10code.com>
+
+ * gpg-connect-agent.c (substitute_line): Allow ${foo} syntax.
+
2007-10-11 Werner Koch <wk at g10code.com>
* gpg-connect-agent.c (get_var): Expand environment variables.
Modified: trunk/tools/gpg-connect-agent.c
===================================================================
--- trunk/tools/gpg-connect-agent.c 2007-10-11 18:18:24 UTC (rev 4591)
+++ trunk/tools/gpg-connect-agent.c 2007-10-12 16:05:14 UTC (rev 4592)
@@ -228,6 +228,8 @@
variable_t var;
const char *s;
+ if (!*name)
+ return "";
for (var = variable_table; var; var = var->next)
if (!strcmp (var->name, name))
break;
@@ -264,10 +266,25 @@
line = p + 1;
continue;
}
- for (pend=p+1; *pend && !spacep (pend) && *pend != '$' ; pend++)
- ;
- if (*pend)
+ if (p[1] == '{')
{
+ for (pend=p+2; *pend && *pend != '}' ; pend++)
+ ;
+ if (!*pend)
+ return result; /* Unclosed - don't substitute. */
+ }
+ else
+ {
+ for (pend=p+1; *pend && !spacep (pend) && *pend != '$' ; pend++)
+ ;
+ }
+ if (p[1] == '{' && *pend == '}')
+ {
+ *pend++ = 0;
+ value = get_var (p+2);
+ }
+ else if (*pend)
+ {
int save = *pend;
*pend = 0;
value = get_var (p+1);
More information about the Gnupg-commits
mailing list