Anonymous avatar Anonymous committed 51d4bfb

Comments (0)

Files changed (3)

 	
 	temp = part_list_prev(*part,PED_PARTITION_METADATA);
 
-	if (temp && (temp->type & desired))
+	if (temp && (temp->type == desired))
 		first = temp->geom.start;
-	else (*part)->geom.start;
+	else 
+		first = (*part)->geom.start;
 
 	temp = part_list_next(*part,PED_PARTITION_METADATA);
 	
-	if (temp && (temp->type & desired))
+	if (temp && (temp->type == desired))
 		last = temp->geom.end;
-	else (*part)->geom.end;
+	else 
+		last = (*part)->geom.end;
 
 	if(!query_part_position(_("Where to place the resized partition"),
 	                        part_position,&pos,first,last,dev,
 	PedSector start = geom->start-127;
 	start = (start > 0 ? start : 0);
 	PedSector end = geom->start+127;
-	end = (end < dev->length-1 ? end : dev->length-1);
+	end = (end < dev->length-1LL ? end : dev->length-1LL);
 	ped_geometry_set (geom, start, end-start+1);
 	new_geom = ped_constraint_solve_nearest (constraint, geom);
 	ped_geometry_set (geom, new_geom->start, new_geom->length);
 	}
  
 	if (end >= dev->length) {
-		end = dev->length;
+		end = dev->length - 1LL;
 		if (sector >= dev->length)
-			sector = dev->length;
+			sector = dev->length - 1LL;
 	}
 
 	if (!ped_geometry_init(value->range, dev, start, end - start + 1LL))
 
 	if (temp && (temp->type & desired))
 		first = temp->geom.start;
-	else part->geom.start;
+	else
+		first = part->geom.start;
 
 	temp = part_list_next(part,PED_PARTITION_METADATA);
 	
 	if (temp && (temp->type & desired))
 		last = temp->geom.end;
-	else part->geom.end;
+	else 
+		last = part->geom.end;
 
 	if(!query_part_position(_("Place for the resized partition"),
 	                        query_opts,&pos,first,last,(*disk)->dev,
 do_select (PedDisk** disk)
 {
 	PedDevice*      dev;
-	if (!fdisk_command_line_get_device (_("New device?"), &dev))
+	if (!get_device (_("New device?"), &dev))
 		return 0;
 	if (!ped_device_open (dev))
 		return 0;
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.