3 @@ -798,7 +798,6 @@ AC_ARG_ENABLE([libmount],
5 UL_BUILD_INIT([libmount])
6 UL_REQUIRES_BUILD([libmount], [libblkid])
7 -UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier])
8 AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
9 AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes -a "x$enable_static" = xyes])
11 --- a/libmount/src/tab_parse.c
12 +++ b/libmount/src/tab_parse.c
14 #include "pathnames.h"
17 +#ifndef HAVE_SCANF_MS_MODIFIER
18 +# define UL_SCNsA "%s"
21 static int next_number(char **s, int *num)
24 @@ -52,16 +56,31 @@ static int mnt_parse_table_line(struct l
26 char *src = NULL, *fstype = NULL, *optstr = NULL;
28 +#ifndef HAVE_SCANF_MS_MODIFIER
29 + size_t len = strlen(s) + 1;
31 + fstype = malloc(len);
32 + fs->target = malloc(len);
33 + optstr = malloc(len);
36 rc = sscanf(s, UL_SCNsA" " /* (1) source */
37 UL_SCNsA" " /* (2) target */
38 UL_SCNsA" " /* (3) FS type */
39 UL_SCNsA" " /* (4) options */
40 "%n", /* byte count */
42 +#ifdef HAVE_SCANF_MS_MODIFIER
56 @@ -127,6 +146,16 @@ static int mnt_parse_mountinfo_line(stru
57 unsigned int maj, min;
58 char *fstype = NULL, *src = NULL, *p;
60 +#ifndef HAVE_SCANF_MS_MODIFIER
61 + size_t len = strlen(s) + 1;
62 + fs->root = malloc(len);
63 + fs->target = malloc(len);
64 + fs->vfs_optstr = malloc(len);
65 + fs->fs_optstr = malloc(len);
66 + fstype = malloc(len);
70 rc = sscanf(s, "%d " /* (1) id */
71 "%d " /* (2) parent */
72 "%u:%u " /* (3) maj:min */
73 @@ -138,9 +167,15 @@ static int mnt_parse_mountinfo_line(stru
77 +#ifdef HAVE_SCANF_MS_MODIFIER
88 if (rc >= 7 && end > 0)
89 @@ -160,9 +195,15 @@ static int mnt_parse_mountinfo_line(stru
90 UL_SCNsA" " /* (9) source */
91 UL_SCNsA, /* (10) fs options (fs specific) */
93 +#ifdef HAVE_SCANF_MS_MODIFIER