Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for libplaton/utils/meetmail/meetmail.c between version 1.2 and 1.3

version 1.2, 2003/01/04 10:14:43 version 1.3, 2003/04/20 21:44:02
Line 16 
Line 16 
  *    14/5/2001 - fixed bug with CONFFILENAMESIZE                         *   *    14/5/2001 - fixed bug with CONFFILENAMESIZE                         *
  *     3/1/2003 - import into CVS; project 'libplaton' directory 'utils'  *   *     3/1/2003 - import into CVS; project 'libplaton' directory 'utils'  *
  *              - made meetmail to work with libplaton library            *   *              - made meetmail to work with libplaton library            *
    *    20/4/2003 - numerous tiny fixes and code cleanups                   *
  *                                                                        *   *                                                                        *
  **************************************************************************/   **************************************************************************/
   
Line 26 
Line 27 
 #include <platon/str/strctype.h>  #include <platon/str/strctype.h>
   
 #ifndef __PRGVERSION__  #ifndef __PRGVERSION__
 #  define __PRGVERSION__        "0.3.2"  #  define __PRGVERSION__        "0.3.3"
 #endif  #endif
   
 #define MEETMAILSTR     \  #define MEETMAILSTR     \
Line 93  int main(int argc, char **argv)
Line 94  int main(int argc, char **argv)
         /* confaddress */          /* confaddress */
         if (argc > 3) {          if (argc > 3) {
                 strncpy(confaddress, argv[3], CONFADDRESSSIZE);                  strncpy(confaddress, argv[3], CONFADDRESSSIZE);
         }          } else {
         else {  
                 strncpy(confaddress, argv[1], CONFADDRESSSIZE);                  strncpy(confaddress, argv[1], CONFADDRESSSIZE);
                 confaddress[CONFADDRESSSIZE] = '\0';                  confaddress[CONFADDRESSSIZE] = '\0';
                 strncpy(strchr(confaddress, '\0'), "@pobox.sk",                  strncpy(strchr(confaddress, '\0'), "@pobox.sk",
Line 106  int main(int argc, char **argv)
Line 106  int main(int argc, char **argv)
         /* conffilename */          /* conffilename */
         if (argc > 4) {          if (argc > 4) {
                 strncpy(conffilename, argv[4], CONFFILENAMESIZE);                  strncpy(conffilename, argv[4], CONFFILENAMESIZE);
         }          } else {
         else {  
                 strncpy(conffilename, "conf.", CONFFILENAMESIZE);                  strncpy(conffilename, "conf.", CONFFILENAMESIZE);
                 conffilename[CONFFILENAMESIZE] = '\0';                  conffilename[CONFFILENAMESIZE] = '\0';
                 strncpy(strchr(conffilename, '\0'), argv[1],                  strncpy(strchr(conffilename, '\0'), argv[1],
                                 CONFFILENAMESIZE - strlen(conffilename));                                  CONFFILENAMESIZE - strlen(conffilename));
                 conffilename[CONFFILENAMESIZE] = '\0';                  conffilename[CONFFILENAMESIZE] = '\0';
                 strncpy(strchr(conffilename, '\0'), ".txt",                  strncpy(strchr(conffilename, '\0'), ".txt",
                                 CONFFILENAMESIZE - strlen(conffilename));                                  CONFFILENAMESIZE - strlen(conffilename));
         }          }
         conffilename[CONFFILENAMESIZE] = '\0';          conffilename[CONFFILENAMESIZE] = '\0';
Line 129  int main(int argc, char **argv)
Line 128  int main(int argc, char **argv)
                                 fprintf(stderr,"main() WARNING: malloc() allocation error.\n");                                  fprintf(stderr,"main() WARNING: malloc() allocation error.\n");
 #endif  #endif
                                 pom=confname;                                  pom=confname;
                         }                          } else {
                         else {  
                                 strcpy(pom,"[");                                  strcpy(pom,"[");
                                 strcpy(strchr(pom,'\0'),confname);                                  strcpy(strchr(pom,'\0'),confname);
                                 strcpy(strchr(pom,'\0'),"]");                                  strcpy(strchr(pom,'\0'),"]");
Line 141  int main(int argc, char **argv)
Line 139  int main(int argc, char **argv)
                                 fputc(' ',stdout);                                  fputc(' ',stdout);
                                 fputs(pom,stdout);                                  fputs(pom,stdout);
                                 fputs(strestr(buf,SUBJECTSTR),stdout);                                  fputs(strestr(buf,SUBJECTSTR),stdout);
                         }                          } else fputs(buf,stdout);
                         else fputs(buf,stdout);  
   
                         fSubjectModified = 1;                          fSubjectModified = 1;
                         if (pom != NULL)                          if (pom != NULL)
                                 free(pom);                                  free(pom);
                 }                  } else if (stristr(buf, REPLYTOSTR) == buf) {
                 else {                          /* Header "Reply-to:" found */
                         /* Header "Reply-to:" altering */                          fputs(REPLYTOSTR,stdout);
                         if (stristr(buf, REPLYTOSTR) == buf) {                          fputc(' ',stdout);
                                 fputs(REPLYTOSTR,stdout);                          fputs(confaddress,stdout);
                                 fputc(' ',stdout);                          fputc('\n',stdout);
                                 fputs(confaddress,stdout);                          fputs(XOLDSTR, stdout);
                                 fputc('\n',stdout);                          fputc('-', stdout);
                                 fReplyToModified=1;                          fputs(buf, stdout);
                         }                          fReplyToModified=1;
                         /* Header "X-Conference-Software:" found */                  } else if (stristr(buf, ERRORSTOSTR) == buf) {
                         else if (strstr(buf, XCONFSOFTSTR) == buf) {  
                                 fputs(XCONFSOFTSTR,stdout);  
                                 fputc(' ',stdout);  
                                 fputs(MEETMAILSTR, stdout);  
                                 fputc('\n',stdout);  
                                 fXConfSoftModified=1;  
   
                                 if (strchr(buf, '-') != NULL) {  
                                         fputs(XOLDSTR, stdout);  
                                         fputs(strchr(buf, '-'), stdout);  
                                 }  
                         }  
                         /* Header "Errors-To:" found */                          /* Header "Errors-To:" found */
                         else if (strstr(buf, ERRORSTOSTR) == buf) {                          fputs(ERRORSTOSTR, stdout);
                                 fputs(ERRORSTOSTR, stdout);                          fputc(' ', stdout);
                                 fputc(' ', stdout);                          fputs(conferrorsto, stdout);
                                 fputs(conferrorsto, stdout);                          fputc('\n', stdout);
                                 fputc('\n', stdout);                          fputs(XOLDSTR, stdout);
                                 fErrorsToModified=1;                          fputc('-', stdout);
                           fputs(buf, stdout);
                           fErrorsToModified=1;
                   } else if (stristr(buf, XCONFSOFTSTR) == buf) {
                           /* Header "X-Conference-Software:" found */
                           fputs(XCONFSOFTSTR,stdout);
                           fputc(' ',stdout);
                           fputs(MEETMAILSTR, stdout);
                           fputc('\n',stdout);
                           if (strchr(buf, '-') != NULL) {
                                 fputs(XOLDSTR, stdout);                                  fputs(XOLDSTR, stdout);
                                 fputc('-', stdout);                                  fputs(strchr(buf, '-'), stdout);
                                 fputs(buf, stdout);  
                         }  
                         else {  
                                 if (! strcmp(buf, "\n"))  
                                         break;  
                                 fputs(buf,stdout);  
                         }                          }
                           fXConfSoftModified=1;
                   } else {
                           if (! strcmp(buf, "\n"))
                                   break;
                           fputs(buf, stdout);
                 }                  }
         }          }
   
Line 229  int main(int argc, char **argv)
Line 221  int main(int argc, char **argv)
         fputc('\n',stdout);          fputc('\n',stdout);
   
         /* E-mail message copying */          /* E-mail message copying */
         while (fgets(buf,BUFSIZE,stdin) != NULL) {          while (fgets(buf, BUFSIZE, stdin) != NULL) {
                 fLastBufWasEOL = strchr(buf, '\n') != NULL ? 1 : 0;                  fLastBufWasEOL = strchr(buf, '\n') != NULL ? 1 : 0;
   
                 if (strchr(buf, '\n') == buf) {                  if (strchr(buf, '\n') == buf) {
                         eol_count++;                          eol_count++;
                 }                  } else {
                 else {  
                         for (; eol_count > 0; eol_count--)                          for (; eol_count > 0; eol_count--)
                                 fputc('\n',stdout);                                  fputc('\n', stdout);
                         fputs(buf,stdout);                          fputs(buf, stdout);
                 }                  }
         }          }
   
Line 252  int main(int argc, char **argv)
Line 243  int main(int argc, char **argv)
                 while (fgets(buf,BUFSIZE,f) != NULL)                  while (fgets(buf,BUFSIZE,f) != NULL)
                         fputs(buf, stdout);                          fputs(buf, stdout);
                 fclose(f);                  fclose(f);
         }          } else {
         else {  
                 fprintf(stdout, "\n\n--\nMeetmail WARNING: "                  fprintf(stdout, "\n\n--\nMeetmail WARNING: "
                                 "Cannot open conference signature file '%s'.", conffilename);                                  "Cannot open conference signature file '%s'.", conffilename);
                 fputs("\nPlease, notice your conference administrator"                  fputs("\nPlease, notice your conference administrator"

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top