The Samba-Bugzilla – Attachment 11293 Details for
Bug 11359
strsep is not available on Solaris
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am cherry-pick from master for 4.3.next 4.2.next, 4.1.next.
0001-lib-replace-Add-strsep-function-missing-on-Solaris.patch (text/plain), 3.24 KB, created by
Jeremy Allison
on 2015-07-29 20:16:27 UTC
(
hide
)
Description:
git-am cherry-pick from master for 4.3.next 4.2.next, 4.1.next.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2015-07-29 20:16:27 UTC
Size:
3.24 KB
patch
obsolete
>From f07b746ad3f3ee2fcbb65a0d452ed80f07c9e8f9 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Wed, 15 Jul 2015 10:43:56 -0700 >Subject: [PATCH] lib: replace: Add strsep function (missing on Solaris). > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=11359 > >Signed-off-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Ira Cooper <ira@wakeful.net> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Wed Jul 29 02:24:55 CEST 2015 on sn-devel-104 >--- > lib/replace/replace.c | 20 ++++++++++++++++++++ > lib/replace/replace.h | 5 +++++ > lib/replace/wscript | 4 ++-- > 3 files changed, 27 insertions(+), 2 deletions(-) > >diff --git a/lib/replace/replace.c b/lib/replace/replace.c >index dccf514..0806ce3 100644 >--- a/lib/replace/replace.c >+++ b/lib/replace/replace.c >@@ -475,6 +475,26 @@ char *rep_strcasestr(const char *haystack, const char *needle) > } > #endif > >+#ifndef HAVE_STRSEP >+char *rep_strsep(char **pps, const char *delim) >+{ >+ char *ret = *pps; >+ char *p = *pps; >+ >+ if (p == NULL) { >+ return NULL; >+ } >+ p += strcspn(p, delim); >+ if (*p == '\0') { >+ *pps = NULL; >+ } else { >+ *p = '\0'; >+ *pps = p + 1; >+ } >+ return ret; >+} >+#endif >+ > #ifndef HAVE_STRTOK_R > /* based on GLIBC version, copyright Free Software Foundation */ > char *rep_strtok_r(char *s, const char *delim, char **save_ptr) >diff --git a/lib/replace/replace.h b/lib/replace/replace.h >index 3ff4e36..c764d06 100644 >--- a/lib/replace/replace.h >+++ b/lib/replace/replace.h >@@ -349,6 +349,11 @@ void rep_setlinebuf(FILE *); > char *rep_strcasestr(const char *haystack, const char *needle); > #endif > >+#ifndef HAVE_STRSEP >+#define strsep rep_strsep >+char *rep_strsep(char **pps, const char *delim); >+#endif >+ > #ifndef HAVE_STRTOK_R > #define strtok_r rep_strtok_r > char *rep_strtok_r(char *s, const char *delim, char **save_ptr); >diff --git a/lib/replace/wscript b/lib/replace/wscript >index 516db2f..30eede2 100644 >--- a/lib/replace/wscript >+++ b/lib/replace/wscript >@@ -240,7 +240,7 @@ def configure(conf): > conf.CHECK_FUNCS('lstat getpgrp utime utimes setuid seteuid setreuid setresuid setgid setegid') > conf.CHECK_FUNCS('setregid setresgid chroot strerror vsyslog setlinebuf mktime') > conf.CHECK_FUNCS('ftruncate chsize rename waitpid wait4') >- conf.CHECK_FUNCS('initgroups pread pwrite strndup strcasestr') >+ conf.CHECK_FUNCS('initgroups pread pwrite strndup strcasestr strsep') > conf.CHECK_FUNCS('strtok_r mkdtemp dup2 dprintf vdprintf isatty chown lchown') > conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf') > conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull') >@@ -630,7 +630,7 @@ REPLACEMENT_FUNCTIONS = { > 'memmove', 'strdup', 'setlinebuf', 'vsyslog', 'strnlen', > 'strndup', 'waitpid', 'seteuid', 'setegid', 'chroot', > 'mkstemp', 'mkdtemp', 'pread', 'pwrite', 'strcasestr', >- 'strtok_r', 'strtoll', 'strtoull', 'setenv', 'unsetenv', >+ 'strsep', 'strtok_r', 'strtoll', 'strtoull', 'setenv', 'unsetenv', > 'utime', 'utimes', 'dup2', 'chown', 'link', 'readlink', > 'symlink', 'lchown', 'realpath', 'memmem', 'vdprintf', > 'dprintf', 'get_current_dir_name', >-- >2.5.0.rc2.392.g76e840b >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
metze
:
review+
Actions:
View
Attachments on
bug 11359
:
11263
|
11284
| 11293