* - format,major,minor[,subdevice]
* When parsing succeeded, `pdev' will contain the appropriate dev_t value.
*/
+
+/* strsep() is not in C90, but strcspn() is. */
+/* Taken from http://unixpapa.com/incnote/string.html */
+static char *
+la_strsep(char **sp, char *sep)
+{
+ char *p, *s;
+ if (sp == NULL || *sp == NULL || **sp == '\0')
+ return(NULL);
+ s = *sp;
+ p = s + strcspn(s, sep);
+ if (*p != '\0')
+ *p++ = '\0';
+ *sp = p;
+ return(s);
+}
+
static int
parse_device(dev_t *pdev, struct archive *a, char *val)
{
return ARCHIVE_WARN;
}
argc = 0;
- while ((p = strsep(&dev, ",")) != NULL) {
+ while ((p = la_strsep(&dev, ",")) != NULL) {
if (*p == '\0') {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
"Missing number");
return;
}
-/* Taken from http://unixpapa.com/incnote/string.html */
-char *
-__la_strsep(char **sp, char *sep)
-{
- char *p, *s;
- if (sp == NULL || *sp == NULL || **sp == '\0')
- return(NULL);
- s = *sp;
- p = s + strcspn(s, sep);
- if (*p != '\0')
- *p++ = '\0';
- *sp = p;
- return(s);
-}
-
#endif /* _WIN32 && !__CYGWIN__ */
extern wchar_t *__la_win_permissive_name_w(const wchar_t *wname);
extern void __la_dosmaperr(unsigned long e);
#define la_dosmaperr(e) __la_dosmaperr(e)
-extern char *__la_strsep(char **sp, char *sep);
-#define strsep(sp, sep) __la_strsep(sp, sep)
extern struct archive_entry *__la_win_entry_in_posix_pathseparator(
struct archive_entry *);