Talk:Find common directory path: Difference between revisions

no edit summary
(Add suggestion for much simpler version for C language)
 
No edit summary
Line 33:
}
</lang>
 
:I think that the last two lines of leastCommonPath are wrong: <lang c> t = strrchr(moving, '/');
if (t && t != moving) *t = '\0';</lang>. This should place the null after the slash, and not eliminate the slash otherwise the slash will not be available for future comparisons. If you change "coverage" to "dovetail" in the example data, I think this problem would raise its head. --[[User:Rdm|Rdm]] 11:46, 14 April 2011 (UTC)
6,951

edits