I have do another experiment.
musl-libc:
i = fnmatch("\\","\\",0); // it returns 0 -> i=0
i = fnmatch("\\","\\",FNM_NOESCAPE); // it also returns 0 -> i=0
But I think this two lines of code should return different value because I set the FNM_NOESCAPE flag.
I also do same experiment in glibc:
glibc:
i = fnmatch("\\","\\",0); // it returns 1 -> i=1
i = fnmatch("\\","\\",FNM_NOESCAPE); // it returns 0 -> i=0
In another case:
musl-libc:
i = fnmatch("[1\\]","[1]",0); // it returns 1 -> i=1
glibc:
i = fnmatch("[1\\]","[1]",0); //it returns 0 -> i=0
Because I DON'T set FNM_NOESCAPE flag, so glibc will escape ']' with two '\'
And the return value should be 0 (match '[1]')
Is it right ?
It would be very helpful if you email me back and tell me what's the problem
Sorry ,my english is so poor.