diff options
author | mvglasow <michael -at- vonglasow.com> | 2015-10-18 00:23:03 +0200 |
---|---|---|
committer | mvglasow <michael -at- vonglasow.com> | 2015-10-18 00:23:03 +0200 |
commit | d7997349bacc4aca7ed67f1adb499a30a7865920 (patch) | |
tree | 2f20630853c06110cb161a27ff8b18fb6d4355fb /navit/navigation.c | |
parent | 3cb94f3adabfdb76fb093ce2efd748b985f20a3e (diff) | |
download | navit-d7997349bacc4aca7ed67f1adb499a30a7865920.tar.gz |
Fix:core:Handle break conditions in navigation_update_idle correctly
Signed-off-by: mvglasow <michael -at- vonglasow.com>
Diffstat (limited to 'navit/navigation.c')
-rw-r--r-- | navit/navigation.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/navit/navigation.c b/navit/navigation.c index 1a435d33f..969eb13ad 100644 --- a/navit/navigation.c +++ b/navit/navigation.c @@ -3695,12 +3695,9 @@ navigation_update_idle(struct navigation *this_) { return; } - while ((count > 0)) { - count--; - if (!(ritem = map_rect_get_item(this_->route_mr))) { - navigation_update_done(this_, 0); - return; - } + while (count > 0) { + if (!(ritem = map_rect_get_item(this_->route_mr))) + break; this_->status |= status_has_ritem; if ((ritem)->type == type_route_start && this_->turn_around > -this_->turn_around_limit+1) this_->turn_around--; @@ -3728,6 +3725,12 @@ navigation_update_idle(struct navigation *this_) { dbg(lvl_debug,"not on track\n"); } navigation_itm_new(this_, ritem); + count--; + } + if (count > 0) { + /* if count > 0, one of the break conditions in the loop was true and we're done */ + navigation_update_done(this_, 0); + return; } } |