@@ -1144,58 +1144,31 @@ enum playlist_thumbnail_name_flags playlist_get_next_thumbnail_name_flag(playlis
11441144void playlist_resolve_path (enum playlist_file_mode mode ,
11451145 bool is_core , char * s , size_t len )
11461146{
1147+ bool resolve_symlinks = true;
1148+
11471149#if IOS
11481150 char tmp [PATH_MAX_LENGTH ];
1149- int _len = 0 ;
11501151
11511152 if (mode == PLAYLIST_LOAD )
11521153 {
1153- if ( is_core
1154- && string_starts_with (s , ":/modules/" )
1155- && string_ends_with (s , ".dylib" ))
1156- {
1157- /* iOS cores used to be packaged as .dylib files in the modules
1158- * directory; App Store rules require turning them into Frameworks and
1159- * putting them in the Frameworks directory. Because some playlists
1160- * include the old core path, we'll translate it here.
1161- */
1162- s [string_index_last_occurance (s , '.' )] = '\0' ;
1163- if (string_ends_with (s , "_ios" ))
1164- s [string_index_last_occurance (s , '_' )] = '\0' ;
1165- _len += strlcpy (tmp + _len , ":/Frameworks/" , STRLEN_CONST (":/Frameworks/" ) + 1 );
1166- _len += strlcpy (tmp + _len , s + STRLEN_CONST (":/modules/" ), sizeof (tmp ) - _len );
1167- /* iOS framework names, to quote Apple:
1168- * "must contain only alphanumerics, dots, hyphens and must not end with a dot."
1169- *
1170- * Since core names include underscore, which is not allowed, but not dot,
1171- * which is, we change underscore to dot.
1172- */
1173- string_replace_all_chars (tmp , '_' , '.' );
1174- strlcpy (tmp + _len , ".framework" , sizeof (tmp ));
1175- fill_pathname_expand_special (s , tmp , len );
1176- }
1177- else
1178- {
1179- fill_pathname_expand_special (tmp , s , sizeof (tmp ));
1180- strlcpy (s , tmp , len );
1181- }
1154+ /* This is probably safe for all platforms, it should end up being just a
1155+ * lot of string copies without changing it */
1156+ fill_pathname_expand_special (tmp , s , sizeof (tmp ));
1157+ strlcpy (s , tmp , len );
11821158 }
11831159 else
11841160 {
1185- /* iOS needs to call realpath here since the call
1186- * above fails due to possibly buffer related issues.
1187- * Try to expand the path to ensure that it gets saved
1188- * correctly. The path can be abbreviated if saving to
1189- * a playlist from another playlist (ex: content history to favorites)
1190- */
1191- char tmp2 [PATH_MAX_LENGTH ];
1161+ /* Try to expand the path to ensure that it gets saved correctly. The path
1162+ * can be abbreviated if saving to a playlist from another playlist (ex:
1163+ * content history to favorites). This is probably safe for all
1164+ * platforms */
11921165 fill_pathname_expand_special (tmp , s , sizeof (tmp ));
1193- realpath (tmp , tmp2 );
1194- fill_pathname_abbreviate_special (s , tmp2 , len );
1166+ path_resolve_realpath (tmp , sizeof (tmp ), resolve_symlinks );
1167+ /* iOS requries this because the full path can change after app update;
1168+ * it's probably safe for all platforms... */
1169+ fill_pathname_abbreviate_special (s , tmp , len );
11951170 }
11961171#else
1197- bool resolve_symlinks = true;
1198-
11991172 if (mode == PLAYLIST_LOAD )
12001173 return ;
12011174
0 commit comments