@@ -413,31 +413,24 @@ namespace Files.FileUtils {
413413 new_path = new_path. slice (Files . ROOT_FS_URI. length, new_path. length);
414414 }
415415
416- return new_path;
417- }
418-
419- // Removes the unwanted `:3` from some Apple device addresses without full sanitizing
420- public string fix_afc_uri (string uri ) {
421- if (Uri . parse_scheme (uri). has_prefix (" afc" )) {
422- var colon_parts = uri. split (" :" , 3 );
416+ if (scheme. has_prefix (" afc" )) {
417+ var colon_parts = new_path. split (" :" , 3 );
423418 if (colon_parts. length > 2 ) {
424419 /* It may be enough to only process device addresses but we deal with all afc uris in case.
425420 * We have to assume the true device name does not contain any colons */
426421 var separator_parts = colon_parts[2 ]. split (Path . DIR_SEPARATOR_S , 2 );
427422 var device_name_end = separator_parts[0 ];
428423 if (uint64 . try_parse (device_name_end)) {
429424 /* Device ends in e.g. `:3`. Need to strip this suffix to successfully browse */
430- var fixed_uri = string . join (" :" , colon_parts[0 ], colon_parts[1 ]);
425+ new_path = string . join (" :" , colon_parts[0 ], colon_parts[1 ]);
431426 if (separator_parts. length > 1 ) {
432- fixed_uri = string . join (Path . DIR_SEPARATOR_S , fixed_uri , separator_parts[1 ]);
427+ new_path = string . join (Path . DIR_SEPARATOR_S , new_path , separator_parts[1 ]);
433428 }
434-
435- return fixed_uri;
436429 }
437430 }
438431 }
439432
440- return uri ;
433+ return new_path ;
441434 }
442435
443436 /* * Splits the path into a protocol ending in '://" and a path beginning "/". **/
0 commit comments