On 29 July 2012 15:30, Martin Sucha <[email protected]> wrote: > Hello, > > I found out that str_cmp's behaviour does not match its documentation. The > difference is when the length of the two strings is not equal: > http://trac.helenos.org/browser/mainline/uspace/lib/c/generic/str.c#L427 > > [...] > > Now my topic for discussion is whether we should fix the implementation or the > documentation. I quickly looked at some usages of this function and it seems > that portions of the codebase depend on the current implementation when > checking equality of strings as str_cmp(a, b) == 0 (or !str_cmp(a, b)). >
Common sense tells me that two strings are equal iff they consist of the same sequence of characters. If one string is longer, it can't be considered the same. I can't imagine any scenario in which someone would need an ordering that is inconsistent with the intuitive notion of string equality. _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/cgi-bin/listinfo/helenos-devel
