]> jfr.im git - irc/hexchat/hexchat.git/commit
Reverse the notify.conf linked list before writing
authorMasoud Naservand <redacted>
Thu, 17 Feb 2022 12:09:05 +0000 (15:39 +0330)
committerPatrick <redacted>
Thu, 17 Feb 2022 16:24:59 +0000 (10:24 -0600)
commit94efa378f7f7329514b04a2f8dadf2b9d57b9f8e
tree0a81bb2a5296cef942549dff8c3eaba747e1a993
parentccf6f431bbd96f04369875d72a61976bb6609a69
Reverse the notify.conf linked list before writing

hexchat populates the single linked list `notify_list` defined in
`src/common/notify.c` from `notify.conf` file. Each new line read from
the file is added to the list by `g_slist_prepend()` which adds it to
the front of the list. But in `notify_save()` the list elements are read
from the start to end of the list and written to the `notify.conf`. This
means everytime hexchat is opened and closed, the contents of
`notify.conf` get reversed. This commit creates a
temporary glist in `notify_save()` and applies `g_slist_reverse()` on it
and writes the contents of this reversed list to `notify.conf`. And
solves issue #2680
src/common/notify.c