Index: /trunk/Ohana/src/libohana/src/string.c
===================================================================
--- /trunk/Ohana/src/libohana/src/string.c	(revision 34752)
+++ /trunk/Ohana/src/libohana/src/string.c	(revision 34753)
@@ -130,5 +130,5 @@
   status = EOF + 1;
   
-  for (i = 0, c = 0; (c != '\n') && (status != EOF); i++) {
+  for (i = 0, c = 0; (c != '\n') && (c != '\r') && (status != EOF); i++) {
     status = fscanf (f, "%c", &c);
     line[i] = c;
@@ -154,5 +154,5 @@
   status = EOF + 1;
   
-  for (i = 0, c = 0; (c != '\n') && (status != EOF) && (i < maxlen); i++) {
+  for (i = 0, c = 0; (c != '\n') && (c != '\r') && (status != EOF) && (i < maxlen); i++) {
     status = fscanf (f, "%c", &c);
     line[i] = c;
Index: /trunk/Ohana/src/opihi/cmd.data/read_vectors.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/read_vectors.c	(revision 34752)
+++ /trunk/Ohana/src/opihi/cmd.data/read_vectors.c	(revision 34753)
@@ -30,6 +30,8 @@
   int i, j, Nskip, Narg, Nvec, *col, IsCSV, VERBOSE;
   int Nbytes, Nstart, NELEM, Nelem, nread, *coltype;
-  char *colstr, *c0, *c1, *buffer, *extname;
+  char *colstr, *c0, *c1, *extname;
   Vector **vec;
+
+  char *buffer = NULL;
 
   /* auto-sense table type */
@@ -155,5 +157,10 @@
   bzero (buffer, 0x10001);
   for (i = 0; i < Nskip; i++) {
-    scan_line (f, buffer);
+    if (scan_line_maxlen (f, buffer, 0x10000) == EOF) {
+      gprint (GP_ERR, "problem reading file %s\n", filename);
+      free (vec);
+      free (col);
+      return FALSE;
+    }
   }
 
@@ -179,4 +186,7 @@
     while (bufferStatus) {
       c1 = strchr (c0, '\n'); // find the end of this current line
+      if (!c1) {
+	c1 = strchr (c0, '\r'); // try \r for non-UNIX files (what do we do about a Mac? \n\r?)
+      }
       if (c1 == (char *) NULL) {
 	Nstart = strlen (c0);
@@ -260,5 +270,5 @@
   free (vec);
   free (col);
-  free (buffer);
+  if (buffer) free (buffer);
   return (TRUE);
 
