freebsd-ports/sysutils/fsearch/files/patch-src_string__utils.c
Alexey Dokuchaev 8f5b0d0149 - Update to the fourth beta version
- Shorten the COMMENT line
- Point WWW line to a working website
2020-06-17 08:44:34 +00:00

30 lines
657 B
C

--- src/string_utils.c.orig 2020-02-24 11:50:22 UTC
+++ src/string_utils.c
@@ -16,6 +16,7 @@
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+#include <glib.h>
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
@@ -62,3 +63,19 @@ fs_str_copy (char *dest, char *end, const char *src)
return ptr;
}
+int
+strverscmp (const char *s1,
+ const char *s2)
+{
+ gchar *tmp1, *tmp2;
+ gint ret;
+
+ tmp1 = g_utf8_collate_key_for_filename(s1, -1);
+ tmp2 = g_utf8_collate_key_for_filename(s2, -1);
+
+ ret = strcmp(tmp1, tmp2);
+
+ g_free(tmp1);
+ g_free(tmp2);
+ return ret;
+}