Commit Graph

1255 Commits

Author SHA1 Message Date
John Tytgat 793d466edf - introduction of SLEN()
- enforce result of url_normalize() being NULL on failure
- plug memory leak when url_normalize() fails

svn path=/trunk/netsurf/; revision=4200
2008-05-25 15:51:30 +00:00
John Mark Bell 5979083a16 Unescape URL before attempting to read filetype
svn path=/trunk/netsurf/; revision=4195
2008-05-24 01:19:21 +00:00
John Mark Bell 2b79c34977 Squash warning
svn path=/trunk/netsurf/; revision=4190
2008-05-23 14:17:31 +00:00
John Mark Bell a16586c9b7 Use local filetype directly, if we're "downloading" a local file
svn path=/trunk/netsurf/; revision=4189
2008-05-23 13:29:37 +00:00
John Mark Bell b15a6af3d2 s/wchar_t/uint32_t/g
We always assumed that the keycode type was 32bits wide, anyway. wchar_t isn't guaranteed to be that big, so isn't remotely portable.

svn path=/trunk/netsurf/; revision=4165
2008-05-16 09:37:22 +00:00
John Mark Bell 23fb72ea6b The core code has always assumed a locale of "C".
Do not change the locale globally, else things will break in weird and 
wonderful ways.

Introduce utils/locale.[ch], which provide locale-specific wrappers for various 
functions (currently just the <ctype.h> ones).

Fix up the few places I can see that actually require that the underlying 
locale is paid attention to.

Some notes:

  1) The GTK frontend code has not been touched. It is possible that reading of 
     numeric values (e.g. from the preferences dialogue) may break with this 
     change, particularly in locales that use something other than '.' as their
     decimal separator.
  2) The search code is left unchanged (i.e. assuming a locale of "C"). 
     This may break case insensitive matching of non-ASCII characters. 
     I doubt that ever actually worked, anyway. In future, it should use
     Unicode case conversion to achieve the same effect.
  3) The text input handling in the core makes use of isspace() to detect
     word boundaries. This is fine for western languages (even in the C locale,
     which it's currently assuming). It will, however, break for CJK et. al. 
     (this has always been the case, rather than being a new issue)
  4) text-transform uses locale-specific variants of to{lower,upper}. In future
     this should probably be performing Unicode case conversion. This is the
     only part of the core code that makes use of locale information.

In future, if you require locale-specific behaviour, do the following:

  setlocale(LC_<whatever>, "");
  <your operation(s) here>
  setlocale(LC_<whatever>, "C");

  The first setlocale will change the current locale to the native environment.
  The second setlocale will reset the current locale to "C".
  Any value other than "" or "C" is probably a bug, unless there's a really
  good reason for it.

In the long term, it is expected that all locale-dependent code will reside in 
platform frontends -- the core being wholly locale agnostic (though assuming 
"C" for things like decimal separators).


svn path=/trunk/netsurf/; revision=4153
2008-05-13 14:37:44 +00:00
John Mark Bell dc85ddb0a8 Launch redirects to unsupported URLs in other applications.
svn path=/trunk/netsurf/; revision=4098
2008-04-19 11:07:42 +00:00
Michael Drake a2616bbfe7 Fix makefile for save text. Remove redundant ifdef.
svn path=/trunk/netsurf/; revision=4096
2008-04-13 22:23:04 +00:00
Rob Kendrick 59641def82 const fixes in plotters and history core
svn path=/trunk/netsurf/; revision=4083
2008-04-07 11:15:09 +00:00
John Tytgat 0d39c69763 - riscos/gui.c(path_to_url): escape the characters which need to be escaped when converting the host path to file: URL.
- utils/{url.c,url.h}(url_escape):
  * added parameter 'toskip' to specify number of input characters which need to be skipped in the escape process. This avoids extra malloc buffer juggling.
  * added parameter 'escexceptions' to specify the characters which need to be excluded from the escape process.

Solves SF tracker ID 1910169.
Note that when discname in path contains '/' characters (case: "file:///Sunfish#192.168.0.50::/home/joty.$/jo.html") or there is no discname specified at all (case "file:///HostFS:$/jo.htm"), you 
need an UnixLib fix as in http://www.riscos.info/websvn/listing.php?repname=gccsdk&path=%2Ftrunk%2Fgcc4%2F&rev=3395&sc=1

svn path=/trunk/netsurf/; revision=4069
2008-04-02 00:43:51 +00:00
John Tytgat 4b7c105afc Remove useless private UnixLib include.
svn path=/trunk/netsurf/; revision=4068
2008-04-01 19:44:57 +00:00
Michael Drake 62ca5e3e11 Tidy up.
svn path=/trunk/netsurf/; revision=4064
2008-03-31 18:59:23 +00:00
Michael Drake 5def4f5e0c Fix formatting of copied or saved text selections.
svn path=/trunk/netsurf/; revision=4063
2008-03-31 18:04:36 +00:00
Adrian Lees aefa03aed9 Save non-opaque images with a proper mask/full alpha channel
svn path=/trunk/netsurf/; revision=4047
2008-03-24 01:35:13 +00:00
Adrian Lees 175395b52d Tidy up when drag save aborted (fixes assert when dragging URL to same window)
svn path=/trunk/netsurf/; revision=4043
2008-03-23 06:07:40 +00:00
Adrian Lees 084bcd631a Ensure 'tracking window' defined when starting selection
svn path=/trunk/netsurf/; revision=4042
2008-03-23 06:06:44 +00:00
Adrian Lees 2fd567590c Added missing initialiser
svn path=/trunk/netsurf/; revision=4041
2008-03-23 06:05:40 +00:00
John Tytgat 0588417b3c Add GCCSDK 4 support (cross-compile, static ELF only atm); Ignore codedocs directory during 'svn status'.
svn path=/trunk/netsurf/; revision=4031
2008-03-22 00:49:56 +00:00
Michael Drake 9d3b7b43fd Update status bar when standalone images are done.
svn path=/trunk/netsurf/; revision=3917
2008-03-10 12:41:41 +00:00
John Tytgat 79022d8ec2 Foresee OSLib 7 and pre-OSLib 7 compatibility
svn path=/trunk/netsurf/; revision=3913
2008-03-10 00:51:51 +00:00
John Tytgat b79b0dbd82 Avoid rendering using random buffer data when content is locked. In such cases we leave the window area as is.
svn path=/trunk/netsurf/; revision=3912
2008-03-10 00:19:11 +00:00
Michael Drake bae61d9224 Periodically reflow the page while fetching a page's objects. Make buffer all rendering default.
svn path=/trunk/netsurf/; revision=3874
2008-02-29 23:03:26 +00:00
John Mark Bell ad6fcea6b0 Add url_fragment to extract fragment from URL
Optionally allow url_compare to ignore fragments in comparison
Fix handling of url_compare result in a few places
Fix redirects which contain fragments in the Location header

svn path=/trunk/netsurf/; revision=3826
2008-02-03 12:04:48 +00:00
John Mark Bell 78d194cb77 Rework handling of HTTP redirects -- we now count the number of redirects followed for a given item and abort if a fixed limit is reached. This fixes sites which have pages that redirect to themselves.
Redirect handling is now transparent to clients of fetchcache.

The new scheme works as follows:

1) Request content for URL (fetchcache()
2) Start fetch of content (fetchcache_go()
3) If no redirect, continue through LOADING, READY, DONE etc. states as before
   If redirect, receive NEWPTR for each redirect that occurs, then continue
   through LOADING, READY, DONE etc. states as before.

The upshot of this is that redirects result in extra contents being created. It also means that, until LOADING has been received, the content (and thus the URL being fetched) may change. Therefore, fetchcache clients should expect to have to deal with transient data prior to LOADING occurring.

As a necessary side-effect of this, the HTML object URLs and CSS @import URLs are no longer stored alongside the relevant contents. These URLs can be accessed by interrogating the url member of struct content anyway, so it was a rather redundant scheme before.

svn path=/trunk/netsurf/; revision=3787
2008-01-28 01:35:00 +00:00
Michael Drake e5cadb5afe Update to real new welcome page path.
svn path=/trunk/netsurf/; revision=3735
2008-01-19 23:42:26 +00:00
John Mark Bell 23053f25da Oops; missed default homepage
svn path=/trunk/netsurf/; revision=3733
2008-01-19 23:30:30 +00:00
John Mark Bell ed3b59964d Fix menu entries
svn path=/trunk/netsurf/; revision=3732
2008-01-19 23:29:28 +00:00
Michael Drake db79ba2042 Update some paths. (Not all done.)
svn path=/trunk/netsurf/; revision=3730
2008-01-19 23:22:21 +00:00
James Bursa 5fdbe77e3e Implement ro_save_draw_path() to enable Draw export of SVGs.
svn path=/trunk/netsurf/; revision=3666
2007-12-11 04:07:35 +00:00
James Bursa 4525ffbd91 Plug a memory leak in ro_plot_path().
svn path=/trunk/netsurf/; revision=3665
2007-12-11 04:06:49 +00:00
James Bursa 9125ffa7d8 Fix warnings and remove some logging.
svn path=/trunk/netsurf/; revision=3664
2007-12-11 02:48:04 +00:00
James Bursa 87a4dc07fd Clear background when redrawing for all except HTML.
svn path=/trunk/netsurf/; revision=3662
2007-12-11 02:42:11 +00:00
Michael Drake d13ac3b066 Increase default font size and line spacing.
svn path=/trunk/netsurf/; revision=3660
2007-12-09 11:13:25 +00:00
James Bursa f386520ff2 Add empty path plotters to stop crashes.
svn path=/trunk/netsurf/; revision=3653
2007-11-29 05:50:21 +00:00
John Mark Bell 6eeeee1778 Ignore SIGPIPE on all platforms, not just RISC OS.
svn path=/trunk/netsurf/; revision=3638
2007-10-31 15:39:55 +00:00
Adrian Lees 0e8a03dc36 Fix recursion when search string is pure wildcard
svn path=/trunk/netsurf/; revision=3633
2007-10-15 22:48:24 +00:00
Richard Wilson 08ea9e706b Allow interactive help to be turned off (implement 1793020)
svn path=/trunk/netsurf/; revision=3631
2007-10-10 21:22:36 +00:00
Richard Wilson 693051471b Check the RAM sprite pool before the ROM sprite pool (fix 1781184)
svn path=/trunk/netsurf/; revision=3628
2007-10-09 17:49:48 +00:00
John Mark Bell b82546a39f Probably fix crash on clicking in url completion dialogue.
URL completion really needs revisiting, as it's full of side effects and has weird and wonderful interactions with other parts of the system.

svn path=/trunk/netsurf/; revision=3535
2007-08-29 00:27:52 +00:00
James Bursa 21db9de5f8 Make F9 dump box tree to an editor for easier debugging.
svn path=/trunk/netsurf/; revision=3529
2007-08-20 02:39:49 +00:00
Vincent Sanders 2f864eeecc Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text
svn path=/trunk/netsurf/; revision=3486
2007-08-08 16:16:03 +00:00
James Bursa 01cc865e02 Improve error message.
svn path=/trunk/netsurf/; revision=3480
2007-08-07 04:01:06 +00:00
James Bursa 5fa0e4a71f Add path plotter (for SVG). Requires other implementations.
svn path=/trunk/netsurf/; revision=3479
2007-08-07 04:00:17 +00:00
James Bursa 07c54283e3 Move window scaling from platform-specific code to desktop/browser.c. Modify gtk gui to handle scaling in the same way as RO.
svn path=/trunk/netsurf/; revision=3478
2007-08-07 03:55:18 +00:00
John Mark Bell c1531c449f Fix string length measurement for strings in icons; if the string came from the templates file, it will be LF terminated, not NUL terminated. Therefore, use a strlen variant that terminates on control characters, rather than just \0. This prevents reading memory beyond the end of the string.
svn path=/trunk/netsurf/; revision=3475
2007-08-04 11:47:40 +00:00
Adrian Lees 86d0dd8563 Workaround for AWRenderer clipping issue (bug #1756230) and improved rendering performance
svn path=/trunk/netsurf/; revision=3456
2007-07-22 04:15:27 +00:00
Michael Drake d2c3d22f52 Change ArtWorks file MIME type to "image/x-artworks".
svn path=/trunk/netsurf/; revision=3449
2007-07-21 00:20:04 +00:00
Adrian Lees 84035a2a1d Use proper background colour for AW files using transparency
svn path=/trunk/netsurf/; revision=3447
2007-07-20 23:51:55 +00:00
James Bursa 895c2e2896 Remove dead code at the end of ro_gui_default_language().
svn path=/trunk/netsurf/; revision=3417
2007-07-15 17:20:25 +00:00
John Mark Bell 1ded087c6a Support dataloading of SVG files
Add internal filetype<->mimetype mapping for SVG files

svn path=/trunk/netsurf/; revision=3407
2007-07-13 08:25:34 +00:00