texlive[58155] Master/texmf-dist: axodraw 2.1.1c (5mar21)

commits+karl at tug.org commits+karl at tug.org
Fri Mar 5 23:27:37 CET 2021


Revision: 58155
          http://tug.org/svn/texlive?view=revision&revision=58155
Author:   karl
Date:     2021-03-05 23:27:37 +0100 (Fri, 05 Mar 2021)
Log Message:
-----------
axodraw 2.1.1c (5mar21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/axodraw2/README
    trunk/Master/texmf-dist/doc/latex/axodraw2/axodraw2-man.pdf
    trunk/Master/texmf-dist/doc/man/man1/axohelp.1
    trunk/Master/texmf-dist/doc/man/man1/axohelp.man1.pdf
    trunk/Master/texmf-dist/source/latex/axodraw2/axohelp.c

Modified: trunk/Master/texmf-dist/doc/latex/axodraw2/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/axodraw2/README	2021-03-05 22:27:20 UTC (rev 58154)
+++ trunk/Master/texmf-dist/doc/latex/axodraw2/README	2021-03-05 22:27:37 UTC (rev 58155)
@@ -1,8 +1,8 @@
-Axodraw2 2.1.1b 2019/09/02
+Axodraw2 2.1.1c 2021/03/05
 ==========================
 
 axodraw2.sty version is v2.1.1 2018/02/15
-axohelp.c version is 1.3 2019/08/30
+axohelp.c version is 1.4 2021/03/05
 
 Axodraw2 is a package that defines macros for drawing Feynman graphs
 in LaTeX documents.

Modified: trunk/Master/texmf-dist/doc/latex/axodraw2/axodraw2-man.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/axohelp.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/axohelp.1	2021-03-05 22:27:20 UTC (rev 58154)
+++ trunk/Master/texmf-dist/doc/man/man1/axohelp.1	2021-03-05 22:27:37 UTC (rev 58155)
@@ -1,4 +1,4 @@
-.TH "axohelp" "1.1" "22 Jan 2018" ""
+.TH "axohelp" "1.4" "5 Mar 2021" ""
 .SH NAME
 axohelp - helper program for use of LaTeX package axodraw2 with
 pdflatex. 

Modified: trunk/Master/texmf-dist/doc/man/man1/axohelp.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/axodraw2/axohelp.c
===================================================================
--- trunk/Master/texmf-dist/source/latex/axodraw2/axohelp.c	2021-03-05 22:27:20 UTC (rev 58154)
+++ trunk/Master/texmf-dist/source/latex/axodraw2/axohelp.c	2021-03-05 22:27:37 UTC (rev 58155)
@@ -73,9 +73,9 @@
 */
 
 #define NAME "axohelp"
-#define VERSIONDATE "2019 Aug 28"
+#define VERSIONDATE "2021 Mar 5"
 #define VERSION 1
-#define SUBVERSION 3
+#define SUBVERSION 4
 
 #define COMMENTCHAR '%'
 #define TERMCHAR ';'
@@ -685,6 +685,11 @@
             if ( argsize == 0 ) newsize = 20;
             else newsize = 2*argsize;
             newargs = (double *)malloc(sizeof(double)*newsize);
+            if (! newargs ) {
+                fprintf(stderr,"%s: Memory allocation error while reading file %s\n",axohelp,inname);
+                free(args);
+                return(0);
+            }
             if ( args == 0 ) { args = newargs; argsize = newsize; }
             else {
                 for ( i = 0; i < argsize; i++ ) newargs[i] = args[i];
@@ -704,6 +709,11 @@
         }
         if ( num+*num2 > argsize ) {
             newargs = (double *)malloc(sizeof(double)*(num+*num2));
+            if (! newargs ) {
+                fprintf(stderr,"%s: Memory allocation error while reading file %s\n",axohelp,inname);
+                free(args);
+                return(0);
+            }
             for ( i = 0; i < num; i++ ) newargs[i] = args[i];
             free(args);
             args = newargs;
@@ -739,6 +749,10 @@
         else s++;
     }
     outargs = (double *)malloc(num*sizeof(double));
+    if (! outargs ) {
+         fprintf(stderr,"%s: Memory allocation error while reading file %s\n",axohelp,inname);
+         return(0);
+    }
     s = buff;
     for ( i = 0; i < num; i++ ) {
         while ( *s == 0 ) s++;
@@ -912,7 +926,7 @@
             if ( inputallocations == 0 ) { newnum = 100; }
             else { newnum = 2*inputallocations; }
             if ( ( newadd = (char **)malloc(newnum*sizeof(char *)) ) == 0 ) {
-                fprintf(stderr,"%s: memory error reading file %s\n",axohelp,inname);
+                fprintf(stderr,"%s: Memory allocation error while reading file %s\n",axohelp,inname);
                 return(-1);
             }
             for ( i = 0; i < inputallocations; i++ ) { newadd[i] = inputs[i]; }
@@ -922,10 +936,10 @@
         }
         inputs[numinputs++] = s;
 /*
-        Now scan for the first comment character. That is the end of the object.
+        Now scan for the first termination character. That is the end of the object.
 */
         while ( *t && ( *t != TERMCHAR || ( *t == TERMCHAR && t[-1] == '\\' ) )
-        && *t != '[' ) t++;
+            && *t != '[' ) t++;
         if ( *t != '[' ) {
             while ( t[-1] == ' ' || t[-1] == '\n' ) t--;
             *t++ = 0;
@@ -955,8 +969,8 @@
         fprintf(stderr,"%s: File error in file %s\n",axohelp,filename);
         exit(1);
     }
-    if ( ( buffer = malloc((filesize+1)*sizeof(char)) ) == 0 ) {
-        fprintf(stderr,"%s: Error allocating %ld bytes of memory",axohelp,filesize+1);
+    if ( ( buffer = (char*)malloc((filesize+1)*sizeof(char)) ) == 0 ) {
+        fprintf(stderr,"%s: Error allocating %ld chars of memory",axohelp,filesize+1);
         exit(1);
     }
 /*
@@ -1058,13 +1072,23 @@
 
 int DoOneObject(char *cinput)
 {
-    // Single point for exit, to ensure proper clean up.
+    // OBSERVE: Single point for exit, to ensure proper clean up.
     int num, i, num1, num2, retcode;
     char *s, *t;
     double *argbuf = 0;
+    char *curline = 0;
     retcode = -1;
     SetDefaults();
 
+    // Store current line here for diagnostics, since parsing is destructive
+    // of input buffer.
+    curline = (char *)malloc( (1+strlen(cinput)) * sizeof(char) + 1 );
+    if (! curline) {
+        fprintf(stderr,"%s: Memory allocation error while reading file %s\n",axohelp,inname);
+        goto EXIT;
+    }
+    strcpy( curline, cinput );
+    
     // Locate number of object:
     s = cinput; while ( *s != '[' ) s++;
     s++; t = s; while ( *t != ']' ) t++;
@@ -1090,7 +1114,7 @@
             goto SUCCESS;
         }
         else {
-            fprintf(stderr,"%s: Illegal request in identification string [0]: %s\n"
+            fprintf(stderr,"%s: Illegal object name in identification string [0]: %s\n"
                         ,axohelp,nameobject);
             goto EXIT; 
         }
@@ -1209,8 +1233,14 @@
  SUCCESS:
     retcode = 0;
  EXIT:
+    fprintf(outfile,"}\n");
+    if (retcode) {
+        fprintf( stderr, "Line in file '%s' causing error is\n  '%.75s'\n",
+                 inname, curline );
+        if ( strlen(curline) > 75 ) { fprintf( stderr, "  (Truncated)\n" ); }
+    }
     if (argbuf) { free(argbuf); }
-    fprintf(outfile,"}\n");
+    if (curline) { free(curline); }
     return(retcode);
 }
 
@@ -1318,8 +1348,14 @@
 */
     s = *argv;
     length = strlen(s);
-    inname  = strcpy(malloc((length+5)*sizeof(char)),s);
-    outname = strcpy(malloc((length+5)*sizeof(char)),s);
+    inname  = (char*)malloc((length+5)*sizeof(char));
+    inname  = strcpy(inname,s);
+    outname  = (char*)malloc((length+5)*sizeof(char));
+    outname = strcpy(outname,s);
+    if ( (!inname) || (!outname) ) {
+        fprintf(stderr,"%s: Memory allocation error in startup\n",axohelp);
+        exit(1);
+    }
     if ( (length > 4) && (strcmp(s+length-4, ".ax1") == 0) ) {
         outname[length-1] = '2';
     }
@@ -1341,6 +1377,7 @@
     if ( error > 0 ) {
         fprintf(stderr,"%s: %d objects in %s were not translated correctly.\n",
             axohelp,error,inname);
+        fprintf( stderr, "  Erroneous data in input file normally corresponds to erroneous arguments\n  for an axodraw object in the .tex file.\n" );
         return(1);
     }
     return(0);



More information about the tex-live-commits mailing list.