Description: Use signed char when reading input.
 Otherwise, EOF will be read as 255 instead of -1 on architectures that default
 to unsigned chars (e.g., ARM and PowerPC).
Author: Doug Torrance <dtorrance@debian.org>
Bug-Debian: https://bugs.debian.org/996561
Forwarded: https://github.com/chriswestbrown/qepcad/pull/3
Last-Update: 2023-08-23

--- a/source/db/convenientstreams.h
+++ b/source/db/convenientstreams.h
@@ -29,7 +29,7 @@
   slwcistream(istream& in, option opt = none)
   {
     string s = "";
-    char c = in.get(); 
+    signed char c = in.get();
     if (opt == skipleadingws) 
       while(c != EOF && (isspace(c) || (c == '\\' && isspace(in.peek())))) c = in.get();
     // States  : 0 = normal, 1 = in comment, 2 = just read a backslash
@@ -92,7 +92,7 @@
     // States  : 0 = normal, 1 = in comment, 2 = just read a backslash
     istream & in = *trueIn;
     int state = 0;
-    char c;
+    signed char c;
     while(ls < buffSize - extra && (c = in.get()))
     {
       if (c == EOF) break;
--- a/extensions/rend/rend.h
+++ b/extensions/rend/rend.h
@@ -43,7 +43,7 @@
   singlelinestream(istream& in, option opt = none)
   {
     string s = "";
-    char c = in.get(); if (opt == skipleadingws) while(c != EOF && isspace(c)) c = in.get();
+    signed char c = in.get(); if (opt == skipleadingws) while(c != EOF && isspace(c)) c = in.get();
     while(c != '\n' && c != EOF) { s += c; c = in.get(); }
     str(s);
   }
--- a/source/convenientstreams.h
+++ b/source/convenientstreams.h
@@ -26,7 +26,7 @@
   slwcistream(istream& in, option opt = none)
   {
     string s = "";
-    char c = in.get(); 
+    signed char c = in.get();
     if (opt == skipleadingws) 
       while(c != EOF && (isspace(c) || c == '\\' && isspace(in.peek()))) c = in.get();
     // States  : 0 = normal, 1 = in comment, 2 = just read a backslash
@@ -88,7 +88,7 @@
     // States  : 0 = normal, 1 = in comment, 2 = just read a backslash
     istream & in = *trueIn;
     int state = 0;
-    char c;
+    signed char c;
     while(ls < buffSize - extra && (c = in.get()))
     {
       if (c == EOF) break;
--- a/extensions/rend/PLOT2DCAD2FILE.cc
+++ b/extensions/rend/PLOT2DCAD2FILE.cc
@@ -38,7 +38,7 @@
   bool 
     z = true, // show zero dimensional cell
     c = true; // make a plot in color
-  char g;
+  signed char g;
   while((g = lin.get()) && g != EOF) {
     switch(g) {
     case 'z': z = false; break;
