diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-09 19:01:15 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-09 19:01:15 +0300 |
commit | f63ed76597b462c60b3a6ad89f8c165ffb87d00c (patch) | |
tree | 2aca3537930bce28acff14c0cee0a11fa1988661 /src/history.c | |
parent | 5f9685010addd4a0f04c13f889856084381dd1c6 (diff) | |
parent | ee17ef3d0135027fbc4ff816dd9e793b4bb0b883 (diff) |
Merge branch 'dev' into work/typesetter
# Conflicts:
# src/gmdocument.c
# src/ui/documentwidget.c
# src/ui/inputwidget.h
Diffstat (limited to 'src/history.c')
-rw-r--r-- | src/history.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/history.c b/src/history.c index 87cf28e6..fdd0ff55 100644 --- a/src/history.c +++ b/src/history.c | |||
@@ -286,7 +286,7 @@ void add_History(iHistory *d, const iString *url ){ | |||
286 | 286 | ||
287 | iBool goBack_History(iHistory *d) { | 287 | iBool goBack_History(iHistory *d) { |
288 | lock_Mutex(d->mtx); | 288 | lock_Mutex(d->mtx); |
289 | if (d->recentPos < size_Array(&d->recent) - 1) { | 289 | if (!isEmpty_Array(&d->recent) && d->recentPos < size_Array(&d->recent) - 1) { |
290 | d->recentPos++; | 290 | d->recentPos++; |
291 | postCommandf_Root(get_Root(), | 291 | postCommandf_Root(get_Root(), |
292 | "open history:1 scroll:%f url:%s", | 292 | "open history:1 scroll:%f url:%s", |
@@ -322,7 +322,8 @@ iBool atLatest_History(const iHistory *d) { | |||
322 | 322 | ||
323 | iBool atOldest_History(const iHistory *d) { | 323 | iBool atOldest_History(const iHistory *d) { |
324 | iBool isOldest; | 324 | iBool isOldest; |
325 | iGuardMutex(d->mtx, isOldest = (d->recentPos == size_Array(&d->recent) - 1)); | 325 | iGuardMutex(d->mtx, isOldest = (isEmpty_Array(&d->recent) || |
326 | d->recentPos == size_Array(&d->recent) - 1)); | ||
326 | return isOldest; | 327 | return isOldest; |
327 | } | 328 | } |
328 | 329 | ||