My apologies for unrelenting perfectionism - I noticed that we can: - colocate the pathv and path in one malloc'ed chunk - can discard xstrdup - can iterate through path with only one char* pointer. Making this code even cleaner, more concise and efficient. http://cr.openjdk.java.net/~martin/webrevs/openjdk8/pathv/