diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -55,7 +55,7 @@ static const char *dataDir_App_ = "~/.config/lagrange"; | |||
55 | #endif | 55 | #endif |
56 | static const char *prefsFileName_App_ = "prefs.cfg"; | 56 | static const char *prefsFileName_App_ = "prefs.cfg"; |
57 | 57 | ||
58 | static const int HISTORY_MAX = 100; | 58 | static const size_t HISTORY_MAX = 100; |
59 | 59 | ||
60 | struct Impl_App { | 60 | struct Impl_App { |
61 | iCommandLine args; | 61 | iCommandLine args; |
@@ -384,6 +384,11 @@ iBool handleCommand_App(const char *cmd) { | |||
384 | init_HistoryItem(&item); | 384 | init_HistoryItem(&item); |
385 | set_String(&item.url, url); | 385 | set_String(&item.url, url); |
386 | pushBack_Array(&d->history, &item); | 386 | pushBack_Array(&d->history, &item); |
387 | /* Don't make it too long. */ | ||
388 | if (size_Array(&d->history) > HISTORY_MAX) { | ||
389 | deinit_HistoryItem(front_Array(&d->history)); | ||
390 | remove_Array(&d->history, 0); | ||
391 | } | ||
387 | } | 392 | } |
388 | } | 393 | } |
389 | printHistory_App_(d); | 394 | printHistory_App_(d); |