home *** CD-ROM | disk | FTP | other *** search
/ The AGA Experience 2 / agavol2.iso / software / utilities / comms / metamail-2.3a / elm113diffs.lha / f2.diff < prev    next >
Text File  |  1992-05-02  |  4KB  |  154 lines

  1. *** Elm113/f2.c    Thu Mar 26 02:40:18 1992
  2. --- new/f2.c    Thu Apr 30 16:03:34 1992
  3. ***************
  4. *** 8,13 ****
  5. --- 8,15 ----
  6.   #include <proto/exec.h>
  7.   #endif
  8.   #ifdef DICE
  9. + #include <clib/dos_protos.h>
  10. + #include <clib/exec_protos.h>
  11.   #include <errno.h>
  12.   #endif
  13.   
  14. ***************
  15. *** 44,50 ****
  16.       long pos;
  17.       FILE *in,*keep,*store;
  18.       struct MailItem *I;
  19. !     char Name[MAX_LINELENGTH];
  20.       char Text[MAX_LINELENGTH];  /* large enough for a single line? */
  21.       BOOL flags_written,folder_has_changed;
  22.       BOOL tmp_AlwaysKeep,tmp_AlwaysDelete;
  23. --- 46,52 ----
  24.       long pos;
  25.       FILE *in,*keep,*store;
  26.       struct MailItem *I;
  27. !     char *Name;
  28.       char Text[MAX_LINELENGTH];  /* large enough for a single line? */
  29.       BOOL flags_written,folder_has_changed;
  30.       BOOL tmp_AlwaysKeep,tmp_AlwaysDelete;
  31. ***************
  32. *** 52,59 ****
  33.       int to_delete,to_store,to_keep;
  34.       int save_num=1;
  35.       char buffer[80];
  36. !     char TitleString[1024];
  37.   
  38.       tmp_AlwaysKeep = AlwaysKeep;
  39.       tmp_AlwaysDelete = AlwaysDelete;
  40.   
  41. --- 54,66 ----
  42.       int to_delete,to_store,to_keep;
  43.       int save_num=1;
  44.       char buffer[80];
  45. !     char *TitleString;
  46.   
  47. +     if (((Name = malloc(MAX_LINELENGTH)) == NULL) ||
  48. +         ((TitleString = malloc(MAX_LINELENGTH)) == NULL)) {
  49. +         status_msg("Unable to allocate memory.",200L);
  50. +         clean_exit(5);
  51. +     }
  52.       tmp_AlwaysKeep = AlwaysKeep;
  53.       tmp_AlwaysDelete = AlwaysDelete;
  54.   
  55. ***************
  56. *** 194,199 ****
  57. --- 201,208 ----
  58.         status_msg(buffer,0L);
  59.       else {
  60.         status_msg("Folder unchanged.",100L);
  61. +       free(Name);
  62. +       free(TitleString);
  63.         return;
  64.       }
  65.   
  66. ***************
  67. *** 206,211 ****
  68. --- 215,222 ----
  69.         fprintf(stderr,"elm: cannot rename folder to backup\n");
  70.         UnLockFile(FolderName);
  71.         UnLockFile(Name);
  72. +       free(Name);
  73. +       free(TitleString);
  74.         return;
  75.       }
  76.   
  77. ***************
  78. *** 226,231 ****
  79. --- 237,244 ----
  80.           Execute(exec,0L,0L);
  81.           UnLockFile(FolderName);
  82.           UnLockFile(Name);
  83. +         free(Name);
  84. +         free(TitleString);
  85.           return;
  86.       }
  87.   
  88. ***************
  89. *** 292,297 ****
  90. --- 305,311 ----
  91.                     fwrite(FileBuffer,1L,len,out);
  92.                 }
  93.               }
  94. + #if 0
  95.   /*
  96.               while(getline(in,Text,&pos) && (pos<=I->ArtikelEnd)) {
  97.                   if (pos<I->ArtikelEnd) {
  98. ***************
  99. *** 330,335 ****
  100. --- 344,350 ----
  101.                   }
  102.               }
  103.   */
  104. + #endif
  105.   /* -------------------------------------------------------------------------- */
  106.   
  107.           }
  108. ***************
  109. *** 342,347 ****
  110. --- 357,364 ----
  111.       UnLockFile(Name);
  112.   
  113.       if (!KeepBackup) remove(Name);
  114. +     free(Name);
  115. +     free(TitleString);
  116.   }
  117.   
  118.   
  119. ***************
  120. *** 489,494 ****
  121. --- 506,512 ----
  122.       long try = 0L;
  123.       while(stat(FolderName,&s)) {
  124.         char msg[80];
  125. + #ifdef EBUSY
  126.         if (errno!=EBUSY) {          /* resource is busy? */
  127.           fprintf(stderr,"elm: error scanning folder, code %d\n",errno);
  128.           *laenge=0L;
  129. ***************
  130. *** 495,500 ****
  131. --- 513,519 ----
  132.           *datum=0L;
  133.           return;
  134.         }
  135. + #endif
  136.         sprintf(msg,"Folder is busy. Stand by. Resynchronizing... try #%ld",++try);
  137.         status_msg(msg,0L);
  138.         Delay(100L);
  139. ***************
  140. *** 511,520 ****
  141. --- 530,541 ----
  142.       long try = 0L;
  143.       while(stat(FolderName,&s)) {
  144.         char msg[80];
  145. + #ifdef EBUSY
  146.         if (errno!=EBUSY) {          /* resource is busy? */
  147.           fprintf(stderr,"elm: error scanning folder, code %d\n",errno);
  148.           return(TRUE);
  149.         }
  150. + #endif
  151.         sprintf(msg,"Folder is busy. Stand by. Resynchronizing... try #%ld",++try);
  152.         status_msg(msg,0L);
  153.         Delay(100L);
  154.