summaryrefslogtreecommitdiffstats
path: root/lib/strutil
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:11:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:11:49 +0000
commit1b88cd5ee8510e90e69f885bfd730ce57621781c (patch)
treeb6b33bd695258f68c68824029c279d660ee4b85e /lib/strutil
parentAdding upstream version 3:4.8.30. (diff)
downloadmc-upstream.tar.xz
mc-upstream.zip
Adding upstream version 3:4.8.31.upstream/3%4.8.31upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/strutil')
-rw-r--r--lib/strutil/Makefile.in2
-rw-r--r--lib/strutil/replace.c2
-rw-r--r--lib/strutil/strescape.c2
-rw-r--r--lib/strutil/strutil.c2
-rw-r--r--lib/strutil/strutil8bit.c18
-rw-r--r--lib/strutil/strutilascii.c2
-rw-r--r--lib/strutil/strutilutf8.c12
-rw-r--r--lib/strutil/strverscmp.c2
-rw-r--r--lib/strutil/xstrtol.c2
9 files changed, 21 insertions, 23 deletions
diff --git a/lib/strutil/Makefile.in b/lib/strutil/Makefile.in
index fe19e5c..483506a 100644
--- a/lib/strutil/Makefile.in
+++ b/lib/strutil/Makefile.in
@@ -134,7 +134,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-sfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-ftp.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-sftp.m4 \
- $(top_srcdir)/m4.include/vfs/mc-vfs-fish.m4 \
+ $(top_srcdir)/m4.include/vfs/mc-vfs-shell.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-undelfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-tarfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-cpiofs.m4 \
diff --git a/lib/strutil/replace.c b/lib/strutil/replace.c
index 99356ee..a2d700d 100644
--- a/lib/strutil/replace.c
+++ b/lib/strutil/replace.c
@@ -1,7 +1,7 @@
/*
Functions for replacing substrings in strings.
- Copyright (C) 2013-2023
+ Copyright (C) 2013-2024
Free Software Foundation, Inc.
Written by:
diff --git a/lib/strutil/strescape.c b/lib/strutil/strescape.c
index a605ad8..1412fee 100644
--- a/lib/strutil/strescape.c
+++ b/lib/strutil/strescape.c
@@ -1,7 +1,7 @@
/*
Functions for escaping and unescaping strings
- Copyright (C) 2009-2023
+ Copyright (C) 2009-2024
Free Software Foundation, Inc.
Written by:
diff --git a/lib/strutil/strutil.c b/lib/strutil/strutil.c
index 0c5f96a..4e24e7f 100644
--- a/lib/strutil/strutil.c
+++ b/lib/strutil/strutil.c
@@ -1,7 +1,7 @@
/*
Common strings utilities
- Copyright (C) 2007-2023
+ Copyright (C) 2007-2024
Free Software Foundation, Inc.
Written by:
diff --git a/lib/strutil/strutil8bit.c b/lib/strutil/strutil8bit.c
index 2002e5e..468e6ea 100644
--- a/lib/strutil/strutil8bit.c
+++ b/lib/strutil/strutil8bit.c
@@ -1,7 +1,7 @@
/*
8bit strings utilities
- Copyright (C) 2007-2023
+ Copyright (C) 2007-2024
Free Software Foundation, Inc.
Written by:
@@ -677,13 +677,14 @@ str_8bit_casecmp (const char *s1, const char *s2)
return strcasecmp (s1, s2);
#else
- gint c1, c2;
g_return_val_if_fail (s1 != NULL, 0);
g_return_val_if_fail (s2 != NULL, 0);
- while (*s1 != '\0' && *s2 != '\0')
+ for (; *s1 != '\0' && *s2 != '\0'; s1++, s2++)
{
+ gint c1, c2;
+
/* According to A. Cox, some platforms have islower's that
* don't work right on non-uppercase
*/
@@ -691,8 +692,6 @@ str_8bit_casecmp (const char *s1, const char *s2)
c2 = isupper ((guchar) * s2) ? tolower ((guchar) * s2) : *s2;
if (c1 != c2)
return (c1 - c2);
- s1++;
- s2++;
}
return (((gint) (guchar) * s1) - ((gint) (guchar) * s2));
@@ -716,11 +715,12 @@ str_8bit_ncasecmp (const char *s1, const char *s2)
#ifdef HAVE_STRNCASECMP
return strncasecmp (s1, s2, n);
#else
- gint c1, c2;
- while (n != 0 && *s1 != '\0' && *s2 != '\0')
+ for (; *s1 != '\0' && *s2 != '\0'; s1++, s2++)
{
- n -= 1;
+ gint c1, c2;
+
+ n--;
/* According to A. Cox, some platforms have islower's that
* don't work right on non-uppercase
*/
@@ -728,8 +728,6 @@ str_8bit_ncasecmp (const char *s1, const char *s2)
c2 = isupper ((guchar) * s2) ? tolower ((guchar) * s2) : *s2;
if (c1 != c2)
return (c1 - c2);
- s1++;
- s2++;
}
if (n == 0)
diff --git a/lib/strutil/strutilascii.c b/lib/strutil/strutilascii.c
index 421bfdb..eb0a742 100644
--- a/lib/strutil/strutilascii.c
+++ b/lib/strutil/strutilascii.c
@@ -1,7 +1,7 @@
/*
ASCII strings utilities
- Copyright (C) 2007-2023
+ Copyright (C) 2007-2024
Free Software Foundation, Inc.
Written by:
diff --git a/lib/strutil/strutilutf8.c b/lib/strutil/strutilutf8.c
index e143abe..9142f3d 100644
--- a/lib/strutil/strutilutf8.c
+++ b/lib/strutil/strutilutf8.c
@@ -1,7 +1,7 @@
/*
UTF-8 strings utilities
- Copyright (C) 2007-2023
+ Copyright (C) 2007-2024
Free Software Foundation, Inc.
Written by:
@@ -901,12 +901,12 @@ str_utf8_offset_to_pos (const char *text, size_t length)
else
{
int result;
- GString *buffer;
+ char *buffer;
- buffer = g_string_new (text);
- str_utf8_fix_string (buffer->str);
- result = g_utf8_offset_to_pointer (buffer->str, length) - buffer->str;
- g_string_free (buffer, TRUE);
+ buffer = g_strdup (text);
+ str_utf8_fix_string (buffer);
+ result = g_utf8_offset_to_pointer (buffer, length) - buffer;
+ g_free (buffer);
return result;
}
}
diff --git a/lib/strutil/strverscmp.c b/lib/strutil/strverscmp.c
index 7d720c5..26ab5e9 100644
--- a/lib/strutil/strverscmp.c
+++ b/lib/strutil/strverscmp.c
@@ -1,7 +1,7 @@
/*
Compare strings while treating digits characters numerically.
- Copyright (C) 1997-2023
+ Copyright (C) 1997-2024
Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/lib/strutil/xstrtol.c b/lib/strutil/xstrtol.c
index a0f93ce..5695c19 100644
--- a/lib/strutil/xstrtol.c
+++ b/lib/strutil/xstrtol.c
@@ -1,6 +1,6 @@
/* A more useful interface to strtol.
- Copyright (C) 1995-2023
+ Copyright (C) 1995-2024
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify