Currently, if the bootfile doesn't contain a directory, the path we use
for config file resolution will use the bootfile as the first component
of path.
For example, if bootfile is:
pxelinux.0
the config files requested will be:
pxelinux.0/<mac>
pxelinux.0/<ips>
pxelinux.0/default
For cases where bootfile is a single file, we need to use a blank
prefix.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
/* strip filename from the bootfile path, leaving only a
* directory */
p = strrchr(basedir, '/');
- if (p)
- *p = '\0';
+ if (!p)
+ p = basedir;
+ *p = '\0';
if (strlen(basedir))
url_str = talloc_asprintf_append(url_str, "%s/",