]> git.pld-linux.org Git - packages/console-tools.git/commitdiff
patches from rawhide
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 17 Nov 2000 12:23:28 +0000 (12:23 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    console-tools-acm.patch -> 1.1
    console-tools-psfgettable.patch -> 1.1
    console-tools-readacm.patch -> 1.1
    console-tools-resizecons.patch -> 1.1

console-tools-acm.patch [new file with mode: 0644]
console-tools-psfgettable.patch [new file with mode: 0644]
console-tools-readacm.patch [new file with mode: 0644]
console-tools-resizecons.patch [new file with mode: 0644]

diff --git a/console-tools-acm.patch b/console-tools-acm.patch
new file mode 100644 (file)
index 0000000..3eeabb4
--- /dev/null
@@ -0,0 +1,227 @@
+--- console-tools-0.3.3/lib/cfont/fontstruct.c.jj      Fri Feb 25 18:19:16 2000
++++ console-tools-0.3.3/lib/cfont/fontstruct.c Fri Feb 25 19:37:42 2000
+@@ -60,6 +60,7 @@ simple_font* read_simple_font (FILE* fon
+       filesize = -1;                 /* cannot know, so say we don't know */
+     }
++  if (0)
+   fprintf (stderr, "Format: %u\n", font_format);
+   
+   /*
+--- console-tools-0.3.3/lib/console/acm.c.jj   Tue Sep 21 19:18:39 1999
++++ console-tools-0.3.3/lib/console/acm.c      Fri Feb 25 19:34:48 2000
+@@ -33,16 +33,7 @@ int acm_load(int fd, FILE *fp) 
+   if (fstat(fp->_fileno, &stbuf)) 
+     perror(_("Cannot stat ACM file")), exit(1);
+-  /* first try a wg15-charmap (glibc) file format */
+-  if (-1 != glibc_acm_read (fp, wbuf, False))
+-    {
+-      if (ioctl(fd,PIO_UNISCRNMAP,wbuf))
+-      perror(_("PIO_UNISCRNMAP ioctl")), exit(1);
+-      else
+-      return 0;
+-    }
+-
+-  /*  next try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */
++  /*  Try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */
+   if (!(parse_failed = (-1 == acm_read_ascii(fp,wbuf,&is_unicode))) ||
+       (S_ISREG(stbuf.st_mode) && 
+        (stbuf.st_size == (sizeof(unicode) * E_TABSZ))))  /* test for binary UTF map by size */
+@@ -122,91 +113,8 @@ int acm_load(int fd, FILE *fp) 
+ }
+-/* Reads a charmap file from /usr/share/i18n/charmaps as a SFM file
+- *
+- * - returns -1 on error.
+- * - returns it in `unicode' in an E_TABSZ-elements array.
+- *   (ie. real 16-bit) mapping.
+- *
+- * FIXME: This is very fragile and depends on the precise syntax of the file.
+- * Works for usual files; probably a yacc grammar would be better
+- */
+-int glibc_acm_read (FILE *fp, unicode buf[], lct_boolean fail_on_error)
+-{
+-  char linebuf [256]; /* line buffer */
+-  char *p;
+-  int in_int, out_int, i;
+-  char *in, *out, *skip;
+-  int charmap_section = 0, linenum = 0;
+-  sigset_t sigset, old_sigset;
+-      
+-  /* first 128 codes defaults to ASCII */ 
+-  for (i=0; i<128; i++) buf[i] = i;
+-  /* remaining defaults to replacement char (usually E_TABSZ = 256) */
+-  for ( ; i<E_TABSZ; i++) buf[i] = 0xfffd;
+-      
+-  /* block SIGCHLD */
+-  sigemptyset (&sigset);
+-  sigaddset (&sigset, SIGCHLD);
+-  sigprocmask (SIG_BLOCK, &sigset, &old_sigset);
+-      
+-  do
+-    { 
+-      if ( NULL == fgets (linebuf, sizeof (linebuf), fp))
+-      {
+-        if (feof (fp))
+-          break;
+-        else if (fail_on_error)
+-          {
+-            perror (_("uni_charmap_read(): error reading line"));
+-            exit (2);
+-          }
+-        else
+-          {
+-            return -1;
+-          }
+-      }
+-      linenum++;
+-              
+-      p = strtok (linebuf," \t\n");
+-
+-      if (!p || *p == '%') 
+-      /* skip empty lines and comments */
+-      continue;
+-      if (*p != '<')
+-      {
+-        if (!strcmp (p,"CHARMAP"))
+-          charmap_section = 1;
+-        continue;
+-      }
+-      if (charmap_section)
+-      {
+-        skip = strtok (NULL, "x");
+-        in = strtok (NULL, "<");
+-        out = strtok (NULL, ">");
+-        if (!in || !out)
+-          {
+-            if (fail_on_error) 
+-              fprintf (stderr,_("Couldn't parse line %d\n"),linenum);
+-            /* restore sig mask */
+-            sigprocmask (SIG_SETMASK, &old_sigset, NULL);
+-            return -1;
+-          }
+-        sscanf (in,"%x",&in_int);
+-        sscanf (out+1, "%x", &out_int);
+-        buf [in_int] = out_int;
+-      }
+-    } while (1);
+-
+-  /* restore sig mask */
+-  sigprocmask (SIG_SETMASK, &old_sigset, NULL);
+-
+-  return 0;
+-}
+-
+-
+ /*
+- * - reads `fp' as a 16-bit ASCII SFM file.
++ * - reads `fp' as a 16-bit ASCII ACM file or wg-15 (glibc) file.
+  * - returns -1 on error.
+  * - returns it in `unicode' in an E_TABSZ-elements array.
+  * - sets `*is_unicode' flagiff there were any non-8-bit
+@@ -223,6 +131,8 @@ int acm_read_ascii(FILE *fp, unicode buf
+   int i;                                        /* loop index - result holder */
+   int ret_code = 0;                             /* return code */
+   sigset_t sigset, old_sigset;
++  int charmap_section = 0, linenum = 0;
++  char *inp, *outp;
+   
+   assert (is_unicode);
+   
+@@ -254,10 +164,44 @@ int acm_read_ascii(FILE *fp, unicode buf
+       /* get "charset-relative charcode", stripping leading spaces */
+       p = strtok(buffer," \t\n");
++      linenum++;
++
+       /* skip empty lines and comments */
+-      if (!p || *p == '#')
++      if (!p || *p == '#' || *p == '%')
+         continue;
++      if (charmap_section)
++      {
++        if (*p != '<')
++          continue;
++        strtok (NULL, "x");
++        inp = strtok (NULL, "<");
++        outp = strtok (NULL, ">");
++        if (!inp || !outp)
++          {
++            /* restore sig mask */
++            sigprocmask (SIG_SETMASK, &old_sigset, NULL);
++            return -1;
++          }
++        sscanf (inp,"%x",&in);
++        sscanf (outp+1, "%x", &on);
++        buf [in] = on;
++        continue;
++      }
++
++      if (!strcmp (p, "CHARMAP"))
++      {
++        charmap_section = 1;
++        ret_code = 0;
++        *is_unicode = True;
++        /* Reinitialize buf because wg-15 (glibc) format starts here. */
++        /* first 128 codes defaults to ASCII */ 
++        for (i=0; i<128; i++) buf[i] = i;
++        /* remaining defaults to replacement char (usually E_TABSZ = 256) */
++        for ( ; i<E_TABSZ; i++) buf[i] = 0xfffd;
++        continue;
++      }
++
+       /* get unicode mapping */
+       q = strtok(NULL," \t\n");
+       if (q) 
+@@ -266,14 +210,14 @@ int acm_read_ascii(FILE *fp, unicode buf
+         if (in < 0 || in > 255)
+           {
+             ret_code = -1;
+-            break;
++            continue;
+           }
+         
+         on = ctoi(q, &tmp_is_unicode);
+         if (in < 0 && on > 65535)
+           {
+             ret_code = -1;
+-            break;
++            continue;
+           }
+         
+         *is_unicode |= tmp_is_unicode;
+@@ -282,7 +226,7 @@ int acm_read_ascii(FILE *fp, unicode buf
+       else 
+       {
+         ret_code = -1;
+-        break;
++        continue;
+       }
+     }
+   while (1); /* terminated by break on feof() */
+--- console-tools-0.3.3/include/lct/console.h.jj       Thu Aug 26 00:00:55 1999
++++ console-tools-0.3.3/include/lct/console.h  Fri Feb 25 18:46:09 2000
+@@ -28,7 +28,6 @@ void acm_save (int fd, char* omfil);
+ int acm_load(int fd, FILE *fp);
+ int fcm_read_ascii(FILE *fp, unsigned char buf[]);
+ int acm_read_ascii(FILE *fp, unicode buf[], lct_boolean* is_unicode);
+-int glibc_acm_read (FILE *fp, unicode buf[], lct_boolean fail_on_error);
+ /* unimap-misc.c */
+ int set_kernel_sfm(int fd, struct unimapdesc *);
+--- console-tools-0.3.3/CREDITS.jj     Thu Aug 26 00:14:53 1999
++++ console-tools-0.3.3/CREDITS        Fri Feb 25 19:03:57 2000
+@@ -50,8 +50,8 @@ N: Joel Hoffman
+ E: joel@wam.umd.edu
+ N: Jakub Jelinek
+-E: jj@sunsite.ms.mff.cuni.cz
+-S: Czech Republic ?
++E: jakub@redhat.com
++S: Czech Republic
+ N: Risto Kankkunen
+ D: Original author of dumpkeys and loadkeys
diff --git a/console-tools-psfgettable.patch b/console-tools-psfgettable.patch
new file mode 100644 (file)
index 0000000..be71472
--- /dev/null
@@ -0,0 +1,21 @@
+--- console-tools-0.3.3/fontfiletools/psfgettable.c.jj Wed Aug 25 22:58:14 1999
++++ console-tools-0.3.3/fontfiletools/psfgettable.c    Mon Mar  6 15:15:42 2000
+@@ -100,6 +100,7 @@ int main(int argc, char *argv[])
+   int glyph;
+   unicode unichar;
+   int fontlen;
++  unsigned char buf[2];
+   miscsetup();
+   
+@@ -158,8 +159,8 @@ int main(int argc, char *argv[])
+       else
+       fprintf(out, "0x%03x\t", glyph);
+-      while ( fread(&unichar, sizeof(unicode), 1, in),
+-            unichar != PSF_SEPARATOR )
++      while ( fread(buf, sizeof(buf), 1, in),
++            (unichar = buf[0] + 256 * buf[1]) != PSF_SEPARATOR )
+       fprintf(out, " U+%04x", unichar);
+       putc('\n', out);
diff --git a/console-tools-readacm.patch b/console-tools-readacm.patch
new file mode 100644 (file)
index 0000000..940a7a3
--- /dev/null
@@ -0,0 +1,35 @@
+--- console-tools-0.3.3/lib/console/acm.c.jj   Sun Jul 16 19:03:25 2000
++++ console-tools-0.3.3/lib/console/acm.c      Mon Jul 17 11:12:44 2000
+@@ -172,12 +172,28 @@ int acm_read_ascii(FILE *fp, unicode buf
+       if (charmap_section)
+       {
++        if (!strcmp (p, "END"))
++          charmap_section = 2;
++
++        if (charmap_section == 2)
++          continue;
++
+         if (*p != '<')
+           continue;
+-        strtok (NULL, "x");
+-        inp = strtok (NULL, "<");
+-        outp = strtok (NULL, ">");
+-        if (!inp || !outp)
++        if (p[1] == 'U' && isxdigit(p[2]) && isxdigit(p[3]) &&
++            isxdigit(p[4]) && isxdigit(p[5]) && p[6] == '>')
++          {
++            outp = p + 1;
++            strtok (NULL, "x");
++            inp = strtok (NULL, " \t\n");
++          }
++        else
++          {
++            strtok (NULL, "x");
++            inp = strtok (NULL, "<");
++            outp = strtok (NULL, ">");
++          }
++        if (!inp || !outp || *outp != 'U')
+           {
+             /* restore sig mask */
+             sigprocmask (SIG_SETMASK, &old_sigset, NULL);
diff --git a/console-tools-resizecons.patch b/console-tools-resizecons.patch
new file mode 100644 (file)
index 0000000..9dbfcf5
--- /dev/null
@@ -0,0 +1,83 @@
+--- console-tools-0.3.3/vttools/resizecons.c.resizecons        Wed Aug 25 23:13:26 1999
++++ console-tools-0.3.3/vttools/resizecons.c   Sun Nov  7 10:45:40 1999
+@@ -128,16 +128,18 @@
+     { NULL, 0, NULL, 0 }
+   };
+-  while ( (c = getopt_long (argc, argv, "-vhc:r:l:", long_opts, NULL)) != EOF)
++  while ( (c = getopt_long (argc, argv, "vhc:r:l:", long_opts, NULL)) != EOF)
+     {
+       switch (c)
+       {
+       case 'h':
+         usage();
+         exit(0);
++        break;
+       case 'v':
+         version();
+         exit(0);
++        break;
+       case 'c':
+         *cols = atoi(optarg);
+         if (*cols == 0)
+@@ -161,41 +163,38 @@
+         *mode = MODE_VGALINES;
+         break;
+       case '?':
++      default:
+         usage();
+         exit(1);
++        break;
+       }
+   }
+    
+-  if (argc == optind +1) /* COLSxROWS case */
++  if (argc == (optind + 1)) /* COLSxROWS case */
+     {
+       if (*rows || *cols)
+       {
+-        fprintf(stderr,_("%s: Invalid arguments"),
++        fprintf(stderr,_("%s: Invalid arguments\n"),
+                 progname);
+         exit(1);
+       }
+-      if ((p = index (argv[optind],'x')) != 0)
+-      {
+-        *cols = atoi (argv[optind]);
+-        *rows = atoi (p+1);
+-        return;
+-      }
+-      else
++      if ((p = index (argv[optind],'x')) == NULL)
+       {
+-        fprintf(stderr,_("%s: Unrecognized argument"),
++        fprintf(stderr, _("%s: Unrecognized argument\n"),
+                 progname);
+         exit(1);
+       }
++      *cols = atoi (argv[optind]);
++      *rows = atoi (p+1);
+       return;
+-     
+     }
+    
+-  if (argc == optind +2) /* COLS ROWS case */
++  if (argc == (optind + 2)) /* COLS ROWS case */
+     {
+       if (*rows || *cols)
+       {
+-        fprintf(stderr,_("%s: Invalid arguments"),
++        fprintf(stderr,_("%s: Invalid arguments\n"),
+                 progname);
+         exit(1);
+       }
+@@ -204,7 +203,7 @@
+       return;
+     }
+        
+-  if (argc == optind && *rows && *cols)
++  if (argc == optind && ((*rows && *cols) || *mode == MODE_VGALINES))
+     return;
+    
+   fprintf (stderr, _("%s: bad number of arguments\n"),
This page took 0.045143 seconds and 4 git commands to generate.