X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Ffolder_addmsg.c;h=f90cedfbae04504f4817e228a528a383dd7e0b6e;hb=b47dac6540ed952b95dbdce78d2a5f48ff0db86b;hp=401896a8d52417dbe8454e144eb0f547937f5cc6;hpb=102679e27468bf6f8e1da24ccb9b0d93c489ec7e;p=mmh diff --git a/sbr/folder_addmsg.c b/sbr/folder_addmsg.c index 401896a..f90cedf 100644 --- a/sbr/folder_addmsg.c +++ b/sbr/folder_addmsg.c @@ -20,7 +20,7 @@ int folder_addmsg (struct msgs **mpp, char *msgfile, int selected, - int unseen, int preserve, int deleting) + int unseen, int preserve, int deleting, char *from_dir) { int infd, outfd, linkerr, first_time, msgnum; char *nmsg, newmsg[BUFSIZ]; @@ -142,7 +142,7 @@ folder_addmsg (struct msgs **mpp, char *msgfile, int selected, if (link (msgfile, newmsg) != -1) { if (deleting) { - (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", pwd(), msgfile); + (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile); (void)ext_hook("ref-hook", oldmsg, newmsg); } else @@ -180,11 +180,11 @@ folder_addmsg (struct msgs **mpp, char *msgfile, int selected, */ if (linkerr == EXDEV) { if (stat (newmsg, &st1) == 0) { - advise (NULL, "message %s:%s already exists", newmsg); + advise (NULL, "message %s:%s already exists", mp->foldpath, newmsg); return -1; } else { if ((infd = open (msgfile, O_RDONLY)) == -1) { - advise (msgfile, "unable to open message %s"); + advise (msgfile, "unable to open message %s", msgfile); return -1; } fstat (infd, &st1); @@ -198,7 +198,7 @@ folder_addmsg (struct msgs **mpp, char *msgfile, int selected, close (outfd); if (deleting) { - (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", pwd(), msgfile); + (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile); (void)ext_hook("ref-hook", oldmsg, newmsg); } else