popt/fix-handle-newly-added-asset-.-call-like-elsewhere.patch
2020-07-25 17:32:52 +08:00

40 lines
1.0 KiB
Diff

From ffa18b1e6a649164788b7c21720293c16d374e92 Mon Sep 17 00:00:00 2001
From: jbj <jbj>
Date: Mon, 24 Jun 2013 21:14:37 +0000
Subject: [PATCH 123/157] - fix: handle newly added asset(...) call like
elsewhere.
---
src/poptconfig.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/poptconfig.c b/src/poptconfig.c
index 9d97ccd..f780974 100644
--- a/src/poptconfig.c
+++ b/src/poptconfig.c
@@ -52,6 +52,12 @@ glob_pattern_p (const char * pattern, int quote)
}
#endif /* !defined(__GLIBC__) */
+#if defined(HAVE_ASSERT_H)
+#include <assert.h>
+#else
+#define assert(_x)
+#endif
+
static int poptGlobFlags = 0;
static int poptGlob_error(UNUSED(const char * epath),
@@ -286,7 +292,7 @@ static int poptConfigLine(poptContext con, char * line)
longName++;
else
longName = fn;
- if (longName == NULL) /* XXX can't happen. */
+assert(longName != NULL); /* XXX can't happen. */
goto exit;
/* Single character basenames are treated as short options. */
if (longName[1] != '\0')
--
1.8.3.1