summaryrefslogtreecommitdiffstats
path: root/helper/appliance.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-10-06 13:50:45 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-10-06 13:50:45 +0100
commit6d9051df32b90c6a4fe6ca1ff9e771b7dfe004fa (patch)
treef90caa03e6dbb662c62533d4c60f430d1f2408b0 /helper/appliance.c
parente576d2ec46adefa14b2d9c3d51e7f19a7810f909 (diff)
downloadfebootstrap-6d9051df32b90c6a4fe6ca1ff9e771b7dfe004fa.tar.gz
febootstrap-6d9051df32b90c6a4fe6ca1ff9e771b7dfe004fa.tar.xz
febootstrap-6d9051df32b90c6a4fe6ca1ff9e771b7dfe004fa.zip
helper: Improve error message when run on random files (thanks Alexey Torkhov).
Diffstat (limited to 'helper/appliance.c')
-rw-r--r--helper/appliance.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/helper/appliance.c b/helper/appliance.c
index b2cc840..c4d0b32 100644
--- a/helper/appliance.c
+++ b/helper/appliance.c
@@ -284,7 +284,9 @@ add_hostfiles (const char *hostfiles_file, struct writer *writer)
if (strchr (hostfile, '*') || strchr (hostfile, '?')) {
char *dirname = xstrdup (hostfile);
char *patt = strrchr (dirname, '/');
- assert (patt);
+ if (!patt)
+ error (EXIT_FAILURE, 0, "%s: line %zu: invalid pattern\n(is this file a supermin appliance hostfiles file?)",
+ hostfiles_file, i+1);
*patt++ = '\0';
char **files = read_dir (dirname);