forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc cmpIgnoreStyle + friends #525
Comments
|
template cmpIgnoreStyleImpl*[T: string | cstring](a, b: T, firstCharCaseSensitive: static bool = false): int =
var result = 0
...
result otherwise its use is error prone and violates user expectations for control flow. (if it were a non-exported template, it would be a bit less problematic since the code is self contained in same module) |
import std/cstrutils
echo cmpIgnoreStyle("", nil) # SIGSEGV |
|
|
|
|
proc cmpIgnoreStyle*(a, b: cstring, blen: int): int =
if a[0] != b[0]: return 1
... => why 1? |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
links
The text was updated successfully, but these errors were encountered: