core: Clean up filename utility API

Remove more unused functions, and change pathname splitting to handle
more cases like duplicate //, and to throw an error on .. as a filename.
This commit is contained in:
Colin Walters committed 2011-12-04 12:12:34 -05:00
1 parent 1f6d49cdb9
commit ae3a5e3c07
3 files changed
+45 -107

No files matched your search

+2 -9
View File
@@ -43,16 +43,9 @@ void ot_util_fatal_literal (const char *msg) G_GNUC_NORETURN;
void ot_util_fatal_gerror (GError *error) G_GNUC_NORETURN;
gboolean ot_util_filename_has_dotdot (const char *path);
gboolean ot_util_filename_validate (const char *name, GError **error);
gboolean ot_util_validate_file_name (const char *name,
GError **error);
GPtrArray *ot_util_sort_filenames_by_component_length (GPtrArray *files);
GPtrArray* ot_util_path_split (const char *path);
char *ot_util_path_join_n (const char *base, GPtrArray *components, int n);
gboolean ot_util_path_split_validate (const char *path, GPtrArray **out_components, GError **error);
void ot_util_set_error_from_errno (GError **error, gint saved_errno);