diff -c --exclude=.depend --exclude='*.html*' -r -w solvers/asl.h /home/ladanyi/Ipopt.orig/Extern/ASL/solvers/asl.h
*** solvers/asl.h	2005-06-25 12:56:47.000000000 -0400
--- /home/ladanyi/Ipopt.orig/Extern/ASL/solvers/asl.h	2006-03-03 14:50:03.000000000 -0500
***************
*** 200,205 ****
--- 200,209 ----
  	char rl_buf[80];
  	void (*iadjfcn) ANSI((void*, unsigned long));
  	void (*dadjfcn) ANSI((void*, unsigned long));
+ 	 /* LL */
+ 	char *snl;
+ 	int snl_pos;
+ 	int snl_len;
  	} EdRead_ASL;
  #define EdRead EdRead_ASL
  
***************
*** 542,547 ****
--- 546,552 ----
  ASL {
  	Edagpars p;
  	Edaginfo i;
+ 	EdRead_ASL Rbackup;
  	};
  
   typedef struct
diff -c --exclude=.depend --exclude='*.html*' -r -w solvers/jac0dim.c /home/ladanyi/Ipopt.orig/Extern/ASL/solvers/jac0dim.c
*** solvers/jac0dim.c	2003-12-13 16:23:55.000000000 -0500
--- /home/ladanyi/Ipopt.orig/Extern/ASL/solvers/jac0dim.c	2006-03-03 14:50:01.000000000 -0500
***************
*** 122,134 ****
  	FILE *nl;
  	int i, k, nlv;
  	char *s, *se;
! 	EdRead ER, *R;
  
  	if (!asl)
  		badasl_ASL(asl,0,"jac0dim");
  	fpinit_ASL();	/* get IEEE arithmetic, if possible */
  
! 	if (stub_len <= 0)
  		for(i = 0; stub[i]; i++);
  	else
  		for(i = stub_len; stub[i-1] == ' ' && i > 0; --i);
--- 122,142 ----
  	FILE *nl;
  	int i, k, nlv;
  	char *s, *se;
! 	EdRead *R;
  
  	if (!asl)
  		badasl_ASL(asl,0,"jac0dim");
  	fpinit_ASL();	/* get IEEE arithmetic, if possible */
  
! 	R = EdReadInit_ASL(&asl->Rbackup, asl, NULL, 0);
! 	if (stub_len < 0) {
! 		/* Treat the stub as the content of the file */
! 		R->snl = stub;
! 		R->snl_pos = 0;
! 		R->snl_len = -stub_len;
! 		nl = NULL;
! 	} else {
! 		if (stub_len == 0)
  			for(i = 0; stub[i]; i++);
  		else
  			for(i = stub_len; stub[i-1] == ' ' && i > 0; --i);
***************
*** 150,156 ****
  		fprintf(Stderr, "can't open %s\n", filename);
  		exit(1);
  		}
! 	R = EdReadInit_ASL(&ER, asl, nl, 0);
  	R->Line = 0;
  	s = read_line(R);
  	binary_nl = 0;
--- 158,165 ----
  			fprintf(Stderr, "can't open %s\n", filename);
  			exit(1);
  		}
! 	}
! 	R->nl = nl;
  	R->Line = 0;
  	s = read_line(R);
  	binary_nl = 0;
***************
*** 285,291 ****
  {
  	FILE *nl;
  
! 	if (nl = jac0dim_ASL(asl, stub, stub_len)) {
  		*M = n_con;
  		*N = n_var;
  		*NO = n_obj;
--- 294,303 ----
  {
  	FILE *nl;
  
! 	/* LL */
! 	nl = jac0dim_ASL(asl, stub, stub_len);
! 
! 	if (nl && stub_len < 0) {
  		*M = n_con;
  		*N = n_var;
  		*NO = n_obj;
diff -c --exclude=.depend --exclude='*.html*' -r -w solvers/misc.c /home/ladanyi/Ipopt.orig/Extern/ASL/solvers/misc.c
*** solvers/misc.c	2005-05-09 00:34:50.000000000 -0400
--- /home/ladanyi/Ipopt.orig/Extern/ASL/solvers/misc.c	2006-03-02 19:38:28.000000000 -0500
***************
*** 44,49 ****
--- 44,86 ----
   static char anyedag[] = "fg_read (or one of its variants)";
   static char psedag[] = "pfg_read, pfgh_read, or jacpdim";
  
+ 
+  int 
+ #ifdef KR_headers
+ LL_getc(R) EdRead *R;
+ #else
+ LL_getc(EdRead *R)
+ #endif
+ {
+ 	int c;
+ 	if (R->nl) {
+ 		c = getc(R->nl);
+ 	} else {
+ 		if (R->snl_pos == R->snl_len) {
+ 			c = EOF;
+ 		} else {
+ 			c = R->snl[R->snl_pos++];
+ 		}
+ 	}
+ 	return c;
+     }
+ 	
+  void 
+ #ifdef KR_headers
+ LL_ungetc(c, R) int c; EdRead *R;
+ #else
+ LL_ungetc(int c, EdRead *R)
+ #endif
+ {
+ 	if (R->nl) {
+ 		ungetc(c, R->nl);
+ 	} else {
+ 		if (c != EOF) {
+ 			R->snl_pos--;
+ 		}
+ 	}
+     }
+ 	
   void
  #ifdef KR_headers
  exit_ASL(R, n) EdRead *R; int n;
***************
*** 359,380 ****
  	int c;
  	R->Line++;
  	R->lineinc = 0;
! 	R->rl_buf[0] = c = getc(R->nl);
  	return c;
  	}
  
   static void
  #ifdef KR_headers
! eatcr(nl) FILE *nl;
  #else
! eatcr(FILE *nl)
  #endif
  {
  	int c;
  
! 	while((c = getc(nl)) == '\r');
  	if (c >= 0 && c != '\n')
! 		ungetc(c, nl);
  	}
  
   char *
--- 396,417 ----
  	int c;
  	R->Line++;
  	R->lineinc = 0;
! 	R->rl_buf[0] = c = LL_getc(R);
  	return c;
  	}
  
   static void
  #ifdef KR_headers
! eatcr(R) EdRead *R;
  #else
! eatcr(EdRead *R)
  #endif
  {
    int c;
  
!   while((c = LL_getc(R)) == '\r');
    if (c >= 0 && c != '\n')
! 	  LL_ungetc(c, R);
  }
  
   char *
***************
*** 399,405 ****
  		}
  	rv = s;
  	for(;;) {
! 		x = getc(nl);
  		if (x < ' ') {
  			if (x < 0) {
   eof:
--- 436,442 ----
  		}
  	rv = s;
  	for(;;) {
! 		x = LL_getc(R);
  		if (x < ' ') {
  			if (x < 0) {
   eof:
***************
*** 413,428 ****
  			if (x == '\n')
  				break;
  			if (x == '\r') {
! 				eatcr(nl);
  				break;
  				}
  			}
  		*s++ = x;
  		if (s >= se) {
  			for(;;) {
! 				x = getc(nl);
  				if (x == '\r') {
! 					eatcr(nl);
  					goto eol;
  					}
  				if (x == '\n')
--- 450,465 ----
  			if (x == '\n')
  				break;
  			if (x == '\r') {
! 				eatcr(R);
  				break;
  				}
  			}
  		*s++ = x;
  		if (s >= se) {
  			for(;;) {
! 				x = LL_getc(R);
  				if (x == '\r') {
! 					eatcr(R);
  					goto eol;
  					}
  				if (x == '\n')
***************
*** 848,853 ****
--- 885,893 ----
  	R->can_end = 0;
  	R->dadjfcn = asl->i.dadjfcn;
  	R->iadjfcn = asl->i.iadjfcn;
+ 	R->snl = NULL;
+ 	R->snl_pos = 0;
+ 	R->snl_len = 0;
  	return R;
  	}
  
diff -c --exclude=.depend --exclude='*.html*' -r -w solvers/pfg_read.c /home/ladanyi/Ipopt.orig/Extern/ASL/solvers/pfg_read.c
*** solvers/pfg_read.c	2005-06-25 12:57:51.000000000 -0400
--- /home/ladanyi/Ipopt.orig/Extern/ASL/solvers/pfg_read.c	2006-03-03 14:56:07.000000000 -0500
***************
*** 4651,4657 ****
  #endif
  {
  	ASLTYPE *asl;
! 	EdRead ER, *R;
  	Jmp_buf JB;
  	Static SS, *S;
  	cgrad *cg, **cgp;
--- 4651,4657 ----
  #endif
  {
  	ASLTYPE *asl;
! 	EdRead ER, *R, Rbackup;
  	Jmp_buf JB;
  	Static SS, *S;
  	cgrad *cg, **cgp;
***************
*** 4667,4674 ****
--- 4667,4679 ----
  	ASL_CHECK(a, asltype, who);
  	asl = (ASLTYPE*)a;
  	S = S_init(&SS, asl);
+ 	Rbackup = a->Rbackup;
  	ed_reset(asl);
  	SS.R = R = EdReadInit_ASL(&ER, a, nl, S);
+ 	/* LL */
+ 	R->snl = Rbackup.snl;
+ 	R->snl_pos = Rbackup.snl_pos;
+ 	R->snl_len = Rbackup.snl_len;
  	if (flags & ASL_return_read_err) {
  		a->i.err_jmp_ = &JB;
  		i = setjmp(JB.jb);
***************
*** 4796,4802 ****
  		ER.can_end = 1;
  		i = edag_peek(R);
  		if (i == EOF) {
! 			fclose(nl);
  			do_ewalk(S);
  			if (imap)
  				del_mblk(kimap, imap);
--- 4801,4808 ----
  		ER.can_end = 1;
  		i = edag_peek(R);
  		if (i == EOF) {
! 			/* LL */
! 			if (nl) fclose(nl);
  			do_ewalk(S);
  			if (imap)
  				del_mblk(kimap, imap);
