Tweak the Lat/Long coordinate parser to allow coordinates of the form: 12.1049° N, 68.2296° W The coordinate parser works by tokenizing coordinates one at a time. Consequently it is invoked twice on user input to get latitude and then longitude. Normally, after parsing the first coordinate, intervening characters such as , or ; and any whitespace would be discarded from the input before parsing the second coordinate. Prior to this patch, if the coordinate format was in degrees followed by a sign (N is a sign in this example), the parser would skip the bit of code that fast forwards past any intervening separators and whitespace (, in this example). This resulted in coordinates of this form not being accepted, because the second parse would start with , 68.2296° W and reject this as an invalid coordinate. To rectify this, the bit of code that fast forwards past separators and whitespace has been broken out from the tokenization loop and performed as a final step after a single coordinate has been completely parsed and validated. Doing it this way makes it independent of the state of the tokenizer, so that the fast-forward code will always execute once a coordinate has been successfully parsed. I've also centralized the list of allowed separators into its own static string; this is necessary as part of the patch but should also make allowing additional separator characters between coordinates trivial in the future, if needed. Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
1017 B
1017 B
- core: add support for separator characters when using degree-style coordinates
- profile: include profile editing in undo system
- mobile: Add a dark theme for statistics
- core: avoid crash with corrupted cloud storage
- mobile: fix profile scaling issue on high DPR devices
- mobile: bring back profile icons
- mobile/Android: add logfiles as attachment to support emails
- planner: make ESC (cancel plan) work when moving handles
- dive list: make dive guide visible in dive list [#3382]
- general: rename dive master to dive guide
- desktop: Don't lose cursor position in notes when switching between windows [#3369]
- Uemis support: fix the ability disconnect/reconnect the Zurich when its filesystem is full
- libdivecomputer: add support for latest BLE hardware in OSTC dive computers
- Always add new entries at the very top of this file above other existing entries and this note.
- Use this layout for new entries:
[Area]: [Details about the change] [reference thread / issue]