Update of /cvsroot/mahogany/M/extra/src/c-client
In directory sc8-pr-cvs1:/tmp/cvs-serv16110/extra/src/c-client

Modified Files:
        mhnt.c 
Log Message:
fix mh_append(), it got corrupted while merging in new c-client version some (long) 
time ago

Index: mhnt.c
===================================================================
RCS file: /cvsroot/mahogany/M/extra/src/c-client/mhnt.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -2 -r1.4 -r1.5
--- mhnt.c      13 Apr 2001 01:10:16 -0000      1.4
+++ mhnt.c      2 Oct 2003 00:22:37 -0000       1.5
@@ -905,15 +905,7 @@
   }
   else last = 0;               /* no messages here yet */
-  if (names) fs_give ((void **) &names);
+  if (s = (void *) names) fs_give ((void **) &s);
 
-  sprintf (tmp + strlen (tmp),"/%lu",++last);
-  if ((fd = open (tmp,_O_WRONLY|_O_CREAT|_O_EXCL,S_IREAD|S_IWRITE)) < 0) {
-    sprintf (tmp,"Can't open append message: %s",strerror (errno));
-    mm_log (tmp,ERROR);
-    return NIL;
-  }
-  i = SIZE (message);          /* get size of message */
-  s = (char *) fs_get (i + 1); /* get space for the data */
-                               /* copy the data w/o CR's */
+  mm_critical (stream);                /* go critical */
   do {
     if (!SIZE (message)) {     /* guard against zero-length */
@@ -942,6 +934,4 @@
     for (size = 0,i = SIZE (message),s = (char *) fs_get (i + 1); i; --i)
       if ((c = SNX (message)) != '\015') s[size++] = c;
-  while (i--) if ((c = SNX (message)) != '\015') s[size++] = c;
-  mm_critical (stream);                /* go critical */
                                /* write the data */
     if ((write (fd,s,size) < 0) || fsync (fd)) {



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to