diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-05-07 16:14:18 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-05-07 16:24:51 +0100 |
commit | c56642819eed87431dff3446fe111f7f3eefaa7d (patch) | |
tree | 397126ca4baac425f9c1c44f3d5c56c681e2c4fe /utils/filepath.c | |
parent | c1e2da80dfa62793ea107cf12408c814e268a54b (diff) | |
download | netsurf-c56642819eed87431dff3446fe111f7f3eefaa7d.tar.gz netsurf-c56642819eed87431dff3446fe111f7f3eefaa7d.tar.bz2 |
add file operations table and make all frontends use it.
This rationalises the path construction and basename file
operations. The default implementation is POSIX which works for all
frontends except windows, riscos and amiga which have differeing path
separators and rules.
These implementations are significantly more robust than the previous
nine implementations and also do not use unsafe strncpy or buffers
with arbitrary length limits.
These implementations also carry full documentation comments.
Diffstat (limited to 'utils/filepath.c')
-rw-r--r-- | utils/filepath.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/utils/filepath.c b/utils/filepath.c index 68e8d7e79..c28a821d7 100644 --- a/utils/filepath.c +++ b/utils/filepath.c @@ -326,25 +326,6 @@ void filepath_free_strvec(char **pathv) } /* exported interface documented in filepath.h */ -char *filepath_append(const char *path, const char *leaf) -{ - int dirname_len; - char *dirname; - - if ((path == NULL) || (leaf == NULL)) { - return NULL; - } - - dirname_len = strlen(path) + strlen(leaf) + 2; - dirname = malloc(dirname_len); - if (dirname != NULL) { - snprintf(dirname, dirname_len, "%s/%s", path, leaf); - } - - return dirname; -} - -/* exported interface documented in filepath.h */ nserror filepath_mkdir_all(const char *fname) { char *dname; |