X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Ffolder_addmsg.c;h=e14c7099d69099a494a29cb3cd23212df598d898;hp=423384a0616898dc1b08992519aded88c8d823d1;hb=1fb6287fc4986668e8f49d7c3bdca27d53e267af;hpb=714b5c530ece27ea2835a313013f5b770163403c diff --git a/sbr/folder_addmsg.c b/sbr/folder_addmsg.c index 423384a..e14c709 100644 --- a/sbr/folder_addmsg.c +++ b/sbr/folder_addmsg.c @@ -6,9 +6,11 @@ ** complete copyright information. */ +#include #include #include #include +#include /* ** Link message into a folder. Return the new number @@ -85,20 +87,6 @@ folder_addmsg(struct msgs **mpp, char *msgfile, int selected, /* should we set the SELECTED bit? */ if (selected) { set_selected(mp, msgnum); - - /* check if highest or lowest selected */ - if (mp->numsel == 0) { - mp->lowsel = msgnum; - mp->hghsel = msgnum; - } else { - if (msgnum < mp->lowsel) - mp->lowsel = msgnum; - if (msgnum > mp->hghsel) - mp->hghsel = msgnum; - } - - /* increment number selected */ - mp->numsel++; } /* @@ -132,20 +120,16 @@ folder_addmsg(struct msgs **mpp, char *msgfile, int selected, if (link(msgfile, newmsg) != -1) { if (deleting) { - (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile); - (void)ext_hook("ref-hook", oldmsg, newmsg); + snprintf(oldmsg, sizeof (oldmsg), "%s/%s", + from_dir, msgfile); + ext_hook("ref-hook", oldmsg, newmsg); } else - (void)ext_hook("add-hook", newmsg, (char *)0); + ext_hook("add-hook", newmsg, NULL); return msgnum; } else { linkerr = errno; -#ifdef EISREMOTE - if (linkerr == EISREMOTE) - linkerr = EXDEV; -#endif /* EISREMOTE */ - /* ** Check if the file in our desired location is ** the same as the source file. If so, then just @@ -188,10 +172,13 @@ folder_addmsg(struct msgs **mpp, char *msgfile, int selected, close(outfd); if (deleting) { - (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile); - (void)ext_hook("ref-hook", oldmsg, newmsg); + snprintf(oldmsg, sizeof oldmsg, + "%s/%s", + from_dir, + msgfile); + ext_hook("ref-hook", oldmsg, newmsg); } else - (void)ext_hook("add-hook", newmsg, (char *)0); + ext_hook("add-hook", newmsg, NULL); return msgnum; }