diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2015-06-20 23:06:20 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2015-06-20 23:18:23 +0300 |
commit | f59f778ea485064a6679892c10c1fd7c9dd65a13 (patch) | |
tree | ded703f8f79cfec5fa49ca71b9059de56568ffa7 | |
parent | 91b66f0a3815e2d1517b4643ba8c15a151aed230 (diff) | |
download | smap-f59f778ea485064a6679892c10c1fd7c9dd65a13.tar.gz smap-f59f778ea485064a6679892c10c1fd7c9dd65a13.tar.bz2 |
Minor changes
* src/smapc.c (prompt): Don't use static string. Fixes coredump
on using "prompt" command.
(get_input_line) [!WITH_READLINE]: Print prompt.
(main): Initialize prompt.
* doc/Makefile.am (GENDOCS): Add html-specific configuration file.
* doc/Config: Renamed to doc/html.init
* modules/guile/guile.c (guile_call_proc): Use scm_c_catch
-rw-r--r-- | doc/Makefile.am | 7 | ||||
-rw-r--r-- | doc/html.init (renamed from doc/Config) | 13 | ||||
-rw-r--r-- | modules/guile/guile.c | 10 | ||||
-rw-r--r-- | src/smapc.c | 14 |
4 files changed, 27 insertions, 17 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index f1ac7a9..d67d4ab 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,3 +1,3 @@ # This file is part of Smap. -# Copyright (C) 2010, 2014 Sergey Poznyakoff +# Copyright (C) 2010, 2014, 2015 Sergey Poznyakoff # @@ -61,3 +61,4 @@ MAKEINFOFLAGS= -GENDOCS=$(srcdir)/gendocs.sh +GENDOCS=$(srcdir)/gendocs.sh --no-copy-images --html '--init-file=$(abs_srcdir)/html.init' +EXTRA_DIST += gendocs.sh @@ -72,3 +73,3 @@ manual: TEXI2DVI="$(TEXI2DVI) -t @finalout" \ - $(GENDOCS) --no-copy-images $(PACKAGE) '$(PACKAGE_NAME) manual' + $(GENDOCS) $(PACKAGE) '$(PACKAGE_NAME) manual' diff --git a/doc/Config b/doc/html.init index 64a7efb..738e2a9 100644 --- a/doc/Config +++ b/doc/html.init @@ -80,10 +80,8 @@ set_from_init_file('BIG_RULE', ''); -# Turn off footer buttons in section split -set_from_init_file('SECTION_FOOTER_BUTTONS', undef); -#set_from_init_file('SECTION_BUTTONS', undef); -# Turn off navigation bars at the bottom of each section in chapter split mode +# Turn off navigation bars at the bottom of each section in chapter split mode, +# or subsection in section split mode. set_from_init_file('HEADERS', undef) - if (get_conf('SPLIT') and (get_conf('SPLIT') eq 'chapter')); -# Use navigation icons + if ((get_conf('SPLIT') eq 'chapter') or (get_conf('SPLIT') eq 'section')); +# Use navigation icons set_from_init_file('ICONS', 1); @@ -154,4 +152,7 @@ my @gray_buttons = (\&gray_document_title, ' ', +set_from_init_file('TOP_BUTTONS', undef); set_from_init_file('SECTION_BUTTONS', \@gray_buttons); set_from_init_file('CHAPTER_BUTTONS', \@gray_buttons); +set_from_init_file('NODE_FOOTER_BUTTONS', \@gray_buttons); +set_from_init_file('SECTION_FOOTER_BUTTONS', \@gray_buttons); set_from_init_file('MISC_BUTTONS', diff --git a/modules/guile/guile.c b/modules/guile/guile.c index afaeef5..ae63a51 100644 --- a/modules/guile/guile.c +++ b/modules/guile/guile.c @@ -1,3 +1,3 @@ /* This file is part of Smap. - Copyright (C) 2010, 2014 Sergey Poznyakoff + Copyright (C) 2010, 2014, 2015 Sergey Poznyakoff @@ -108,6 +108,6 @@ guile_call_proc(SCM *result, SCM proc, SCM arglist) - *result = scm_internal_lazy_catch(SCM_BOOL_T, - eval_catch_body, - scm_cons(proc, arglist), - eval_catch_handler, &jmp_env); + *result = scm_c_catch(SCM_BOOL_T, + eval_catch_body, scm_cons(proc, arglist), + eval_catch_handler, &jmp_env, + NULL, NULL); return 0; diff --git a/src/smapc.c b/src/smapc.c index 3fe930b..3beaa63 100644 --- a/src/smapc.c +++ b/src/smapc.c @@ -50,3 +50,4 @@ int batch_mode; struct in_addr source_addr; -char *prompt = "(smapc) "; +#define DEFAULT_PROMPT "(smapc) " +char *prompt; int cmdprefix = '.'; @@ -127,7 +128,11 @@ get_input_line(FILE *fp, int interactive) -#ifdef WITH_READLINE if (interactive) { +#ifdef WITH_READLINE return readline(prompt); - } +#else + fputs(prompt, stdout); + fflush(stdout); #endif + } + if (bufsize == 0) { @@ -755,2 +760,5 @@ main(int argc, char **argv) + if (!prompt) + prompt = estrdup(DEFAULT_PROMPT); + if (server_option) |