commit 0cf455bc48ee95cdb6c420e139fc0abbbe3ed5ab
parent 3e1fc6385b4e6f8d19ce44dda0a64a4d3ffb0d2c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 14 Feb 2018 17:47:08 +0100
build: fix compilation when configured with --enable-tiny
And when configured with --enable-tiny --enable-nanorc.
Diffstat:
3 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -318,9 +318,11 @@ void flip_newbuffer(void)
void discard_buffer(void)
{
}
+#ifdef ENABLE_NANORC
void implant(void)
{
}
+#endif
/* Add a function to the function list. */
void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *help,
@@ -1385,11 +1387,13 @@ void set_spell_shortcuts(void)
/* Execute the function of the given shortcut. */
void execute(const sc *shortcut)
{
+#ifdef ENABLE_NANORC
if (shortcut->scfunc == implant)
/* Insert the corresponding string into the keyboard buffer. */
for (int i = strlen(shortcut->expansion); i > 0; i--)
put_back(shortcut->expansion[i - 1]);
else
+#endif
shortcut->scfunc();
}
diff --git a/src/nano.h b/src/nano.h
@@ -439,6 +439,8 @@ typedef struct sc {
int ordinal;
/* The how-manieth toggle this is, in order to be able to
* keep them in sequence. */
+#endif
+#ifdef ENABLE_NANORC
char *expansion;
/* The string of keycodes to which this shortcut is expanded. */
#endif
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -335,6 +335,8 @@ bool is_universal(void (*func)(void))
func == do_home || func == do_end ||
#ifndef NANO_TINY
func == do_prev_word_void || func == do_next_word_void ||
+#endif
+#ifndef ENABLE_NANORC
func == implant ||
#endif
func == do_delete || func == do_backspace ||
@@ -420,7 +422,9 @@ void parse_binding(char *ptr, bool dobind)
newsc = nmalloc(sizeof(sc));
newsc->scfunc = implant;
newsc->expansion = mallocstrcpy(NULL, funcptr + 1);
+#ifndef NANO_TINY
newsc->toggle = 0;
+#endif
} else
newsc = strtosc(funcptr);