Anonymous avatar Anonymous committed cbe85b2

Fix m4/libparted.m4 to work with versions like 2.1

Comments (0)

Files changed (1)

 	int		major, minor, micro;
 	const char	*version;
 
+	major = 0;
+	minor = 0;
+	micro = 0;
+	
 	if ( !(version = ped_get_version ()) )
 		exit(1);
-	if (sscanf(version, "%d.%d.%d", &major, &minor, &micro) != 3) {
-		printf("%s, bad version string\n", version);
-		exit(1);
-	}
+	/* if (sscanf(version, "%d.%d.%d", &major, &minor, &micro) != 3) */
+	if(sscanf(version, "%d.%d.%d", &major, &minor, &micro) <= 1)
+		{
+			printf("%s, bad version string\n", version);
+			exit(1);
+		}
+	
+	printf("%d.%d.%d ", major, minor, micro);
 
 	if ((major > $parted_config_major_version) ||
 	   ((major == $parted_config_major_version) && (minor > $parted_config_minor_version)) ||
 		printf("\n*** An old version of libparted (%s) was found.\n",
 		       version);
 		printf("*** You need a version of libparted equal to or newer than %d.%d.%d.\n",
+
 			$parted_config_major_version,
 			$parted_config_minor_version,
 			$parted_config_micro_version);
 		printf("*** You can get it at - ftp://ftp.gnu.org/gnu/parted/\n");
 		return 1;
 	}
+
 }
 ],
     AC_MSG_RESULT(yes); $2,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.