diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-10-23 18:42:07 +0100 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-10-23 18:42:07 +0100 |
commit | d38f07cc04a1d491ac521af1886e1c0daec5bcc4 (patch) | |
tree | 094b6fbf07ce48303315bd7b8b63e0b926cf10ce /amiga | |
parent | ffd197b848bf5f0564c90df03765edfa1a3d1a14 (diff) | |
download | netsurf-d38f07cc04a1d491ac521af1886e1c0daec5bcc4.tar.gz netsurf-d38f07cc04a1d491ac521af1886e1c0daec5bcc4.tar.bz2 |
Use url_nice to generate the initial filename for save requesters.
Note: We always strip the extension (AmigaOS doesn't need it anyway), which might not necessarily be what you want.
Diffstat (limited to 'amiga')
-rw-r--r-- | amiga/file.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/amiga/file.c b/amiga/file.c index dc283a45f..f8f21fd2d 100644 --- a/amiga/file.c +++ b/amiga/file.c @@ -218,13 +218,16 @@ void ami_file_save_req(int type, struct gui_window_2 *gwin, struct hlcache_handle *object) { char *fname = AllocVecTags(1024, NULL); + char *initial_fname = NULL; + + if(object) url_nice(nsurl_access(hlcache_handle_get_url(object)), &initial_fname, true); if(AslRequestTags(savereq, ASLFR_Window, gwin->win, ASLFR_SleepWindow, TRUE, ASLFR_TitleText, messages_get("NetSurf"), ASLFR_Screen, scrn, - ASLFR_InitialFile, object ? FilePart(nsurl_access(hlcache_handle_get_url(object))) : "", + ASLFR_InitialFile, initial_fname ? initial_fname : "", TAG_DONE)) { strlcpy(fname, savereq->fr_Drawer, 1024); @@ -234,6 +237,7 @@ void ami_file_save_req(int type, struct gui_window_2 *gwin, } if(fname) FreeVec(fname); + if(initial_fname) free(initial_fname); } void ami_file_req_init(void) |