Hi James, On 10/20/20 1:02 PM, James Prestwood wrote: > This is to allow this API to be used simply to get the file name > without extension. AP will be storing provisioning files similarly > to the network format but the extension will not map to existing > security types. For this case it makes sense to allow a NULL type > which will prevent the security type from being set/parsed. > --- > src/storage.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/src/storage.c b/src/storage.c > index 00d93933..9ef84e32 100644 > --- a/src/storage.c > +++ b/src/storage.c > @@ -287,6 +287,11 @@ char *storage_get_network_file_path(enum security type, const char *ssid) > return path; > } > > +/* > + * Get filename (without extension) which IWD treats as an SSID. Optionally > + * parse the extension to get the security type (*.psk, *.open, *.8021x) by > + * providing a 'type' pointer. > + */ > const char *storage_network_ssid_from_path(const char *path, > enum security *type) No, please don't do this. Make up a AP specific API function instead and commonize the implementation if needed. > { > @@ -302,7 +307,10 @@ const char *storage_network_ssid_from_path(const char *path, > > end = strchr(filename, '.'); > > - if (!end || !security_from_str(end + 1, type)) > + if (!end) > + return NULL; > + > + if (type && !security_from_str(end + 1, type)) > return NULL; > > if (filename[0] != '=') { > Regards, -Denis