52
debian/patches/Partially-revert-lib-src-Use-strsep-3-instead-of-its-patt.patch
vendored
Normal file
52
debian/patches/Partially-revert-lib-src-Use-strsep-3-instead-of-its-patt.patch
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
From: Chris Hofstaedtler <zeha@debian.org>
|
||||
Date: Mon, 17 Feb 2025 12:26:07 +0100
|
||||
Subject: Partially revert "lib/, src/: Use strsep(3) instead of its pattern"
|
||||
|
||||
This reverts src/chfn.c from commit 16cb664865541162c504a6f5ef5ca4b38b5e0c9a.
|
||||
---
|
||||
src/chfn.c | 17 +++++++++++------
|
||||
1 file changed, 11 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/chfn.c b/src/chfn.c
|
||||
index 4c96fba..f06cb44 100644
|
||||
--- a/src/chfn.c
|
||||
+++ b/src/chfn.c
|
||||
@@ -216,27 +216,32 @@ static void new_fields (void)
|
||||
*/
|
||||
static char *copy_field (char *in, char *out, char *extra)
|
||||
{
|
||||
- while (NULL != in) {
|
||||
- char *f;
|
||||
+ char *cp = NULL;
|
||||
|
||||
- f = strsep(&in, ",");
|
||||
+ while (NULL != in) {
|
||||
+ cp = strchr (in, ',');
|
||||
+ if (NULL != cp) {
|
||||
+ *cp++ = '\0';
|
||||
+ }
|
||||
|
||||
- if (strchr(f, '=') == NULL)
|
||||
+ if (strchr (in, '=') == NULL) {
|
||||
break;
|
||||
+ }
|
||||
|
||||
if (NULL != extra) {
|
||||
if (!streq(extra, "")) {
|
||||
strcat (extra, ",");
|
||||
}
|
||||
|
||||
- strcat(extra, f);
|
||||
+ strcat (extra, in);
|
||||
}
|
||||
+ in = cp;
|
||||
}
|
||||
if ((NULL != in) && (NULL != out)) {
|
||||
strcpy (out, in);
|
||||
}
|
||||
|
||||
- return in;
|
||||
+ return cp;
|
||||
}
|
||||
|
||||
/*
|
||||
1
debian/patches/series
vendored
1
debian/patches/series
vendored
@@ -10,3 +10,4 @@ upstream/a015e919834c90b99947829c6c823f7fe93a8097-E_BAD_NAME.patch
|
||||
upstream/man-useradd.8.xml-Document-new-exit-code-19-E_BAD_NAME.patch
|
||||
upstream/Revert-lib-src-Use-local-time-for-human-readable-dates.patch
|
||||
Revert-lib-strtoday.c-strtoday-Fix-calculation.patch
|
||||
Partially-revert-lib-src-Use-strsep-3-instead-of-its-patt.patch
|
||||
|
||||
Reference in New Issue
Block a user