diff options
author | Werner Koch <wk@gnupg.org> | 2016-07-06 19:35:15 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2016-07-06 19:35:15 +0200 |
commit | 511c2522b95333226a5e45e538fed29dd44c9be3 (patch) | |
tree | 4273ef98ad4342023ecafd764bfe7ecc7b5f64f0 /doc/mkdefsinc.c | |
parent | wks: Let the server take the encrytion key from the file. (diff) | |
download | gnupg2-511c2522b95333226a5e45e538fed29dd44c9be3.tar.xz gnupg2-511c2522b95333226a5e45e538fed29dd44c9be3.zip |
doc: Escape file names in generated macros.
* doc/mkdefsinc.c (print_filename): New.
(main): Use it here.
--
Our Jenkins uses an @ in directory names and thus our builds break.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'doc/mkdefsinc.c')
-rw-r--r-- | doc/mkdefsinc.c | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/doc/mkdefsinc.c b/doc/mkdefsinc.c index f3e2f35c7..b8fbed6e9 100644 --- a/doc/mkdefsinc.c +++ b/doc/mkdefsinc.c @@ -140,6 +140,27 @@ get_date_from_files (char **files) } +/* We need to escape file names for Texinfo. */ +static void +print_filename (const char *prefix, const char *name) +{ + const char *s; + + fputs (prefix, stdout); + for (s=name; *s; s++) + switch (*s) + { + case '@': fputs ("@atchar{}", stdout); break; + case '{': fputs ("@lbracechar{}", stdout); break; + case '}': fputs ("@rbracechar{}", stdout); break; + case ',': fputs ("@comma{}", stdout); break; + case '\\':fputs ("@backslashchar{}", stdout); break; + case '#': fputs ("@hashchar{}", stdout); break; + default: putchar (*s); break; + } + putchar('\n'); +} + int main (int argc, char **argv) @@ -288,17 +309,16 @@ main (int argc, char **argv) fputs ("\n@c Directories\n\n", stdout); - fputs ("@set BINDIR " GNUPG_BINDIR "\n" - "@set LIBEXECDIR " GNUPG_LIBEXECDIR "\n" - "@set LIBDIR " GNUPG_LIBDIR "\n" - "@set DATADIR " GNUPG_DATADIR "\n" - "@set SYSCONFDIR " GNUPG_SYSCONFDIR "\n" - "@set LOCALSTATEDIR " GNUPG_LOCALSTATEDIR "\n" - "@set LOCALCACHEDIR " GNUPG_LOCALSTATEDIR - /* */ "/cache/" PACKAGE_NAME "\n" - "@set LOCALRUNDIR " GNUPG_LOCALSTATEDIR - /* */ "/run/" PACKAGE_NAME "\n" - , stdout); + print_filename ("@set BINDIR ", GNUPG_BINDIR ); + print_filename ("@set LIBEXECDIR ", GNUPG_LIBEXECDIR ); + print_filename ("@set LIBDIR ", GNUPG_LIBDIR ); + print_filename ("@set DATADIR ", GNUPG_DATADIR ); + print_filename ("@set SYSCONFDIR ", GNUPG_SYSCONFDIR ); + print_filename ("@set LOCALSTATEDIR ", GNUPG_LOCALSTATEDIR ); + print_filename ("@set LOCALCACHEDIR ", (GNUPG_LOCALSTATEDIR + "/cache/" PACKAGE_NAME)); + print_filename ("@set LOCALRUNDIR ", (GNUPG_LOCALSTATEDIR + "/run/" PACKAGE_NAME)); p = xstrdup (GNUPG_SYSCONFDIR); pend = strrchr (p, '/'); |