OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=596
69 lines
2.3 KiB
Diff
69 lines
2.3 KiB
Diff
From b1d7b517bccc944d609c0509faa08cfe4d7e96b6 Mon Sep 17 00:00:00 2001
|
|
From: Karel Zak <kzak@redhat.com>
|
|
Date: Tue, 13 May 2025 11:24:48 +0200
|
|
Subject: [PATCH 1/4] treewide: add ul_ to parse_range() function name
|
|
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
---
|
|
disk-utils/partx.c | 2 +-
|
|
include/strutils.h | 2 +-
|
|
lib/strutils.c | 2 +-
|
|
text-utils/column.c | 2 +-
|
|
4 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/disk-utils/partx.c b/disk-utils/partx.c
|
|
index 49d506158..4c8b1f09b 100644
|
|
--- a/disk-utils/partx.c
|
|
+++ b/disk-utils/partx.c
|
|
@@ -864,7 +864,7 @@ int main(int argc, char **argv)
|
|
what = ACT_LIST;
|
|
break;
|
|
case 'n':
|
|
- if (parse_range(optarg, &lower, &upper, 0))
|
|
+ if (ul_parse_range(optarg, &lower, &upper, 0))
|
|
errx(EXIT_FAILURE, _("failed to parse --nr <M-N> range"));
|
|
break;
|
|
case 'o':
|
|
diff --git a/include/strutils.h b/include/strutils.h
|
|
index 63cd1c1c6..198d625ba 100644
|
|
--- a/include/strutils.h
|
|
+++ b/include/strutils.h
|
|
@@ -260,7 +260,7 @@ extern int string_to_bitarray(const char *list, char *ary,
|
|
extern int string_to_bitmask(const char *list,
|
|
unsigned long *mask,
|
|
long (*name2flag)(const char *, size_t));
|
|
-extern int parse_range(const char *str, int *lower, int *upper, int def);
|
|
+extern int ul_parse_range(const char *str, int *lower, int *upper, int def);
|
|
|
|
extern int streq_paths(const char *a, const char *b);
|
|
|
|
diff --git a/lib/strutils.c b/lib/strutils.c
|
|
index 0cf0da96b..dd098a318 100644
|
|
--- a/lib/strutils.c
|
|
+++ b/lib/strutils.c
|
|
@@ -863,7 +863,7 @@ int string_to_bitmask(const char *list,
|
|
*
|
|
* Returns: 0 on success, <0 on error.
|
|
*/
|
|
-int parse_range(const char *str, int *lower, int *upper, int def)
|
|
+int ul_parse_range(const char *str, int *lower, int *upper, int def)
|
|
{
|
|
char *end = NULL;
|
|
|
|
diff --git a/text-utils/column.c b/text-utils/column.c
|
|
index d67251648..a929cd813 100644
|
|
--- a/text-utils/column.c
|
|
+++ b/text-utils/column.c
|
|
@@ -482,7 +482,7 @@ static void apply_columnflag_from_list(struct column_control *ctl, const char *l
|
|
}
|
|
|
|
/* parse range (N-M) */
|
|
- if (strchr(*one, '-') && parse_range(*one, &low, &up, 0) == 0) {
|
|
+ if (strchr(*one, '-') && ul_parse_range(*one, &low, &up, 0) == 0) {
|
|
for (; low <= up; low++) {
|
|
if (low < 0)
|
|
cl = get_last_visible_column(ctl, (low * -1) -1);
|
|
--
|
|
2.48.1
|
|
|