tLet happy helping snowman help you in case no menu item is given. - geomyidae - A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log
Files
Refs
README
LICENSE
---
commit 6b8a124ccaf406cac311bf3370f6e07c71752321
parent a10c97c30ba60dc3a6f04007944add595226060d
Author: Christoph Lohmann <20h@r-36.net>
Date:   Mon, 19 Nov 2018 03:04:00 +0100

Let happy helping snowman help you in case no menu item is given.

Diffstat:
  ind.c                               |      17 +++++++++++++++++
  index.gph                           |       1 +

2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/ind.c b/ind.c
t@@ -341,6 +341,23 @@ getadv(char *str)
                         addelem(ret, b);
                 }
                 free(o);
+
+                if (ret->e != NULL && ret->e[0] != NULL && ret->e[0][0] == '\0') {
+                        freeelem(ret);
+                        ret = xcalloc(1, sizeof(Elems));
+
+                        addelem(ret, "i");
+                        addelem(ret, "Happy helping ☃ here: You did not "
+                                "specify an item type on this line. Please "
+                                "review your scripts. "
+                                "Have a nice day!");
+                        addelem(ret, "Err");
+                        addelem(ret, "server");
+                        addelem(ret, "port");
+
+                        return ret;
+                }
+
                 if (ret->e != NULL && ret->num == 5)
                         return ret;
 
diff --git a/index.gph b/index.gph
t@@ -4,6 +4,7 @@ tcomment
 [0|file - comment|/file.dat|server|port]
 [h|http://www.heise.de|URL:http://www.heise.de|server|port]
 [0|some \| escape and [ special characters ] test|error|server|port]
+[|empty type||server|port]
 some        invalid line