Hi Ege.
+#define IOS_FILE_HANDLER_NORMALIZE(handler, newhandler)
\
+{ \
+ /* File devices are special, in the sense that they accept any \
+ handler. However, we want to ensure that the ios name is
\
+ unambiguous from other ios devices, by prepending ./ to relative
\
+ names that might otherwise be confusing. */ \
+ static const char safe[] =
\
+ "abcdefghijklmnopqrstuvwxyz" \
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
+ "0123456789/+_-"; \
+ \
+ if (handler[0] == '/' || strspn (handler, safe) == strlen (handler))
\
+ (newhandler) = strdup ((handler));
\
+ \
+ if (asprintf (&(newhandler), "./%s", (handler)) == -1) \
+ (newhandler) = NULL; \
+}
Maybe it would be better to use a static inline function here?
Otherwise, please surround the macro body with do..while(0)
Other than that, OK for master.
Thanks! :)