Whoops, there is another unused text field. If we use this one as
authorJoey Schulze <joey@infodrom.org>
Sun, 11 Nov 2001 18:06:45 +0000 (18:06 +0000)
committerJoey Schulze <joey@infodrom.org>
Sun, 11 Nov 2001 18:06:45 +0000 (18:06 +0000)
well we may use up to 62 text fields

dtaus.5
dtaus.c

diff --git a/dtaus.5 b/dtaus.5
index 7b593ce..a6d9810 100644 (file)
--- a/dtaus.5
+++ b/dtaus.5
@@ -65,7 +65,7 @@ Here's a short sample for a control file:
 
   ...
 
 
   ...
 
-You may use up to 61 fields entitle
+You may use up to 62 fields entitle
 .BR Text .
 They will be recorded one by one and stored into additional data
 records.  This way you could add a detailed description of the type of
 .BR Text .
 They will be recorded one by one and stored into additional data
 records.  This way you could add a detailed description of the type of
diff --git a/dtaus.c b/dtaus.c
index 35ebd44..4ad2310 100644 (file)
--- a/dtaus.c
+++ b/dtaus.c
@@ -98,7 +98,7 @@ dtaus_record recC[] = {
 #define C_EXT  11
 #define C_LEN  12
 
 #define C_EXT  11
 #define C_LEN  12
 
-#define MAX_TEXT 60
+#define MAX_TEXT 61
 
 dtaus_record recE[] = {
   {"Anzahl", 10, 7, IGN},
 
 dtaus_record recE[] = {
   {"Anzahl", 10, 7, IGN},
@@ -491,7 +491,7 @@ void dtaus_prepareC (char *buf, int normaltext, int maxtext)
   if (normaltext)
     appendix = 1;
   if (maxtext) {
   if (normaltext)
     appendix = 1;
   if (maxtext) {
-    res = div (maxtext, 4);
+    res = div (maxtext-1, 4);
     appendix += res.quot;
     if (res.rem) appendix++;
   }
     appendix += res.quot;
     if (res.rem) appendix++;
   }
@@ -644,7 +644,12 @@ int dtaus_writeC(FILE *f, char **valuesA, char **values, char **text)
   }
 
   if (text) {
   }
 
   if (text) {
-    res = div (maxtext, 4);
+    buf[recC[C_EXT].pos+0] = '0';
+    buf[recC[C_EXT].pos+1] = '2';
+    sprintf (tmp, "%-27s", upcase(text[0]));
+    for (i=0; i<recC[C_EXT].len-2; i++) buf[recC[C_EXT].pos+2+i] = tmp[i];
+
+    res = div (maxtext-1, 4);
     i=res.quot;
     if (res.rem) i++;
 
     i=res.quot;
     if (res.rem) i++;
 
@@ -654,11 +659,11 @@ int dtaus_writeC(FILE *f, char **valuesA, char **values, char **text)
 
   fputs(buf, f);
 
 
   fputs(buf, f);
 
-  if (text) {
-    fieldnr=0;
+  if (text && maxtext > 1) {
+    fieldnr=1;
     while (fieldnr<maxtext) {
       memset (appendix, ' ', 128);
     while (fieldnr<maxtext) {
       memset (appendix, ' ', 128);
-      appendix[128] = '0';
+      appendix[128] = '\0';
       for (k=0; k<4 && (fieldnr+k)<maxtext; k++) {
        sprintf (tmp, "%-27s", upcase(text[fieldnr+k]));
        appendix[k*29] = '0';
       for (k=0; k<4 && (fieldnr+k)<maxtext; k++) {
        sprintf (tmp, "%-27s", upcase(text[fieldnr+k]));
        appendix[k*29] = '0';
@@ -720,7 +725,7 @@ void dtaus2control (char *cdtaus, char *ccontrol)
   char x[30];
   int index, countC;
 
   char x[30];
   int index, countC;
 
-  if (!cdtaus) {{
+  if (!cdtaus) {
     if (!(fdtaus = fopen("DTAUS0.TXT", "r")))
       if (!(fdtaus = fopen("dtaus0.txt", "r")))
        return;
     if (!(fdtaus = fopen("DTAUS0.TXT", "r")))
       if (!(fdtaus = fopen("dtaus0.txt", "r")))
        return;