patch 9.0.1359: too many "else if" statements in handling options
Problem: Too many "else if" statements in handling options.
Solution: Add more functions for handling option changes. (Yegappan
Lakshmanan, closes #12060)
diff --git a/src/map.c b/src/map.c
index 92f7651..7c95286 100644
--- a/src/map.c
+++ b/src/map.c
@@ -3088,11 +3088,10 @@
}
if (to == NUL)
{
- // TODO: Need to use errbuf argument for this error message
- // and return it.
- semsg(_(e_langmap_matching_character_missing_for_str),
- transchar(from));
- return NULL;
+ sprintf(args->os_errbuf,
+ _(e_langmap_matching_character_missing_for_str),
+ transchar(from));
+ return args->os_errbuf;
}
if (from >= 256)
@@ -3112,10 +3111,10 @@
{
if (p[0] != ',')
{
- // TODO: Need to use errbuf argument for this error
- // message and return it.
- semsg(_(e_langmap_extra_characters_after_semicolon_str), p);
- return NULL;
+ sprintf(args->os_errbuf,
+ _(e_langmap_extra_characters_after_semicolon_str),
+ p);
+ return args->os_errbuf;
}
++p;
}