Index: uspace/lib/posix/src/fnmatch.c
===================================================================
--- uspace/lib/posix/src/fnmatch.c	(revision 6ff23ff32c8aa9d6ad8d06f1743ca1b0d68c14bc)
+++ uspace/lib/posix/src/fnmatch.c	(revision ed88c8e9e48e792fdd0df46568e33e36eb624db3)
@@ -33,5 +33,6 @@
  */
 
-/* This file contains an implementation of the fnmatch() pattern matching
+/*
+ * This file contains an implementation of the fnmatch() pattern matching
  * function. There is more code than necessary to account for the possibility
  * of adding POSIX-like locale support to the system in the future. Functions
@@ -54,5 +55,6 @@
 #define INVALID_PATTERN -1
 
-/* Type for collating element, simple identity with characters now,
+/*
+ * Type for collating element, simple identity with characters now,
  * but may be extended for better locale support.
  */
@@ -70,5 +72,5 @@
  * @return Matching collating element or COLL_ELM_INVALID.
  */
-static coll_elm_t _coll_elm_get(const char* str)
+static coll_elm_t _coll_elm_get(const char *str)
 {
 	if (str[0] == '\0' || str[1] != '\0') {
@@ -306,25 +308,5 @@
 }
 
-/**
- * Matches the beginning of the given string against a bracket expression
- * the pattern begins with.
- *
- * @param pattern Pointer to the beginning of a bracket expression in a pattern.
- *     On success, the pointer is moved to the first character after the
- *     bracket expression.
- * @param str Unmatched part of the string.
- * @param flags Flags given to fnmatch().
- * @return INVALID_PATTERN if the pattern is invalid, 0 if there is no match
- *     or the number of matched characters on success.
- */
-static int _match_bracket_expr(const char **pattern, const char *str, int flags)
-{
-	const bool pathname = (flags & FNM_PATHNAME) != 0;
-	const bool special_period = (flags & FNM_PERIOD) != 0;
-	const char *p = *pattern;
-	bool negative = false;
-	int matched = 0;
-
-	#define _matched(match) { \
+#define _matched(match) { \
 		int _match = match; \
 		if (_match < 0) { \
@@ -337,4 +319,24 @@
 	}
 
+/**
+ * Matches the beginning of the given string against a bracket expression
+ * the pattern begins with.
+ *
+ * @param pattern Pointer to the beginning of a bracket expression in a pattern.
+ *     On success, the pointer is moved to the first character after the
+ *     bracket expression.
+ * @param str Unmatched part of the string.
+ * @param flags Flags given to fnmatch().
+ * @return INVALID_PATTERN if the pattern is invalid, 0 if there is no match
+ *     or the number of matched characters on success.
+ */
+static int _match_bracket_expr(const char **pattern, const char *str, int flags)
+{
+	const bool pathname = (flags & FNM_PATHNAME) != 0;
+	const bool special_period = (flags & FNM_PERIOD) != 0;
+	const char *p = *pattern;
+	bool negative = false;
+	int matched = 0;
+
 	assert(*p == '[');  /* calling code should ensure this */
 	p++;
@@ -342,5 +344,6 @@
 	if (*str == '\0' || (pathname && *str == '/') ||
 	    (pathname && special_period && *str == '.' && *(str - 1) == '/')) {
-		/* No bracket expression matches end of string,
+		/*
+		 * No bracket expression matches end of string,
 		 * slash in pathname match or initial period with FNM_PERIOD
 		 * option.
@@ -398,6 +401,4 @@
 		return negative ? 0 : matched;
 	}
-
-	#undef _matched
 }
 
@@ -416,5 +417,6 @@
 static bool _partial_match(const char **pattern, const char **string, int flags)
 {
-	/* Only a single *-delimited subpattern is matched here.
+	/*
+	 * Only a single *-delimited subpattern is matched here.
 	 * So in this function, '*' is understood as the end of pattern.
 	 */
@@ -473,5 +475,6 @@
 
 		if (*p == '\0') {
-			/* End of pattern, must match end of string or
+			/*
+			 * End of pattern, must match end of string or
 			 * an end of subdirectory name (optional).
 			 */
@@ -628,12 +631,12 @@
 #include <stdio.h>
 
+#define fnmatch_test(x) { if (x) printf("SUCCESS: "#x"\n"); else { printf("FAILED: "#x"\n"); fail++; } }
+#define match(s1, s2, flags) fnmatch_test(fnmatch(s1, s2, flags) == 0)
+#define nomatch(s1, s2, flags) fnmatch_test(fnmatch(s1, s2, flags) == FNM_NOMATCH)
+
 void __posix_fnmatch_test()
 {
 	int fail = 0;
 
-	#undef assert
-	#define assert(x) { if (x) printf("SUCCESS: "#x"\n"); else { printf("FAILED: "#x"\n"); fail++; } }
-	#define match(s1, s2, flags) assert(fnmatch(s1, s2, flags) == 0)
-	#define nomatch(s1, s2, flags) assert(fnmatch(s1, s2, flags) == FNM_NOMATCH)
 
 	static_assert(FNM_PATHNAME == FNM_FILE_NAME);
