-- StrNCpy(portstr, p, Min(strcspn(p, "#" WHITESPACE) + 1,
-+ while (isspace((unsigned char) *p))
-+ p++;
-+ StrNCpy(portstr, p, Min(strcspn(p, "#" WHITESPACE) + 1,
- sizeof(portstr)));
-+ }
-+ if (strncmp(p, "unix_socket_directory", strlen("unix_socket_directory")) == 0)
-+ {
-+ p += strlen("unix_socket_directory");
+@@ -452,6 +451,26 @@
+ /* and save the argument value */
+ StrNCpy(portstr, p, Min((q - p) + 1, sizeof(portstr)));
+ /* keep looking, maybe there is another */
++ } else if(!strncmp(p, "unix_socket_directory", 21)) {
++ p += 21;