···11+/*
22+ * Copyright (C) 2009 Rocco Rutte <pdmef@gmx.net>
33+ *
44+ * This program is free software; you can redistribute it and/or modify
55+ * it under the terms of the GNU General Public License as published by
66+ * the Free Software Foundation; either version 2 of the License, or
77+ * (at your option) any later version.
88+ *
99+ * This program is distributed in the hope that it will be useful,
1010+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1111+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212+ * GNU General Public License for more details.
1313+ *
1414+ * You should have received a copy of the GNU General Public License
1515+ * along with this program; if not, write to the Free Software
1616+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1717+ */
1818+1919+#if HAVE_CONFIG_H
2020+# include "config.h"
2121+#endif
2222+2323+#include "mutt.h"
2424+#include "mbyte.h"
2525+2626+int wcscasecmp (const wchar_t *a, const wchar_t *b)
2727+{
2828+ const wchar_t *p = a;
2929+ const wchar_t *q = b;
3030+ int i;
3131+3232+ if (!a && !b)
3333+ return 0;
3434+ if (!a && b)
3535+ return -1;
3636+ if (a && !b)
3737+ return 1;
3838+3939+ for ( ; *p || *q; p++, q++)
4040+ {
4141+ if ((i = towlower (*p)) - towlower (*q))
4242+ return i;
4343+ }
4444+ return 0;
4545+}