From 34a02eaaaf87f6608fc7cb13d60f1217f36f6502 Mon Sep 17 00:00:00 2001
From: Philipp Gesang <phg@phi-gamma.net>
Date: Wed, 23 Dec 2015 00:04:34 +0100
Subject: [mkstatus] safer parsing of git-describe(1) output

---
 scripts/mkstatus | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/mkstatus b/scripts/mkstatus
index 62161a8..c5ded0d 100755
--- a/scripts/mkstatus
+++ b/scripts/mkstatus
@@ -164,7 +164,9 @@ local git_info = function ()
   --io.write "\n"
   local desc = readpipe (describecmd)
   if not desc then die "cannot parse git information" end
-  local desc = string.explode (string.fullstrip (desc), "/")[2]
+  desc = string.fullstrip (desc)
+  local desc = string.explode (desc, "/")[2] or desc
+  if not desc then die "cannot parse sanitized git information" end
   local data = readpipe (logcmd)
   if data and type (data) == "string" and data ~= "" then
     data = load (data)
-- 
cgit v1.2.3