diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2006-07-06 00:07:11 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2006-07-06 00:07:11 +0000 |
commit | badad073ec99b49288421e99a701f3a61f1fac55 (patch) | |
tree | 1ff96c8f43de077f8e40cac272cc587f43f3e834 /riscos/gui.c | |
parent | 55389c543be402eeca097cde75a68d8b1315b980 (diff) | |
download | netsurf-badad073ec99b49288421e99a701f3a61f1fac55.tar.gz netsurf-badad073ec99b49288421e99a701f3a61f1fac55.tar.bz2 |
Generate directory listings (fix 1397934)
svn path=/trunk/netsurf/; revision=2719
Diffstat (limited to 'riscos/gui.c')
-rw-r--r-- | riscos/gui.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/riscos/gui.c b/riscos/gui.c index 5abddac3d..53fd4ea74 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -2157,6 +2157,8 @@ void ro_gui_view_source(struct content *content) char full_name[256]; char *temp_name, *r; wimp_full_message_data_xfer message; + int objtype; + bool done = false; if (!content || !content->source_data) { warn_user("MiscError", "No document source"); @@ -2166,10 +2168,15 @@ void ro_gui_view_source(struct content *content) /* try to load local files directly. */ temp_name = url_to_path(content->url); if (temp_name) { - snprintf(message.file_name, 212, "%s", temp_name); - message.file_name[211] = '\0'; + error = xosfile_read_no_path(temp_name, &objtype, 0, 0, 0, 0); + if ((!error) && (objtype == osfile_IS_FILE)) { + snprintf(message.file_name, 212, "%s", temp_name); + message.file_name[211] = '\0'; + done = true; + } free(temp_name); - } else { + } + if (!done) { /* We cannot release the requested filename until after it * has finished being used. As we can't easily find out when * this is, we simply don't bother releasing it and simply |