INN commit: trunk (doc/pod/innconfval.pod lib/innconf.c)
INN Commit
Russ_Allbery at isc.org
Sun Apr 12 20:26:00 UTC 2009
Date: Sunday, April 12, 2009 @ 13:26:00
Author: iulius
Revision: 8416
Return a space-separated string for Bourne shell innconfval
output.
Modified:
trunk/doc/pod/innconfval.pod
trunk/lib/innconf.c
------------------------+
doc/pod/innconfval.pod | 6 +++---
lib/innconf.c | 16 ++++++++++------
2 files changed, 13 insertions(+), 9 deletions(-)
Modified: doc/pod/innconfval.pod
===================================================================
--- doc/pod/innconfval.pod 2009-04-12 20:19:35 UTC (rev 8415)
+++ doc/pod/innconfval.pod 2009-04-12 20:26:00 UTC (rev 8416)
@@ -67,8 +67,8 @@
variables will be exported. String values will be enclosed in single
quotes with appropriate escaping, and boolean values will be mapped to
C<true> or C<false>. String parameters that are set to NULL will be
-mapped to empty strings. List values will be mapped to a string
-representing an array of strings (as Bourne shell does not recognize
+mapped to empty strings. List values will be mapped to a space-separated
+string representing an array of strings (as Bourne shell does not recognize
arrays, contrary to several other shells, an array cannot be returned
for interoperability reasons).
@@ -76,7 +76,7 @@
DOMAIN=''; export DOMAIN;
ENABLEOVERVIEW=true; export ENABLEOVERVIEW;
- EXTRAOVERVIEWADVERTISED='( "Newsgroups" "Injection-Info" )'; export EXTRAOVERVIEWADVERTISED;
+ EXTRAOVERVIEWADVERTISED='"Newsgroups" "Injection-Info"'; export EXTRAOVERVIEWADVERTISED;
EXTRAOVERVIEWHIDDEN='( )'; export EXTRAOVERVIEWHIDDEN;
ORGANIZATION='Let'\''s try nasty "quotes"'; export ORGANIZATION;
MAXFORKS=10; export MAXFORKS;
Modified: lib/innconf.c
===================================================================
--- lib/innconf.c 2009-04-12 20:19:35 UTC (rev 8415)
+++ lib/innconf.c 2009-04-12 20:26:00 UTC (rev 8416)
@@ -748,10 +748,10 @@
upper = xstrdup(key);
for (p = upper; *p != '\0'; p++)
*p = toupper(*p);
- /* For interoperability reasons, we return a string representing
- * an array (pure Bourne shell does not have the notion of an
- * array for instance). */
- fprintf(file, "%s='( ", upper);
+ /* For interoperability reasons, we return a space-separated string
+ * representing an array (pure Bourne shell does not have the notion
+ * of an array for instance). */
+ fprintf(file, "%s='", upper);
if (value != NULL && value->strings != NULL) {
for (i = 0; i < value->count; i++) {
fprintf(file, "\"");
@@ -766,10 +766,14 @@
else
fputc(*letter, file);
}
- fprintf(file, "\" ");
+ if (i == value->count - 1) {
+ fprintf(file, "\"");
+ } else {
+ fprintf(file, "\" ");
+ }
}
}
- fprintf(file, ")'; export %s;\n", upper);
+ fprintf(file, "'; export %s;\n", upper);
free(upper);
break;
case INNCONF_QUOTE_PERL:
More information about the inn-committers
mailing list