mush 6.0 patch for Pyramid

Paul Lew lew at gsg.UUCP
Fri Apr 22 12:39:05 AEST 1988


Description:
	Mush failed to compile 'print.c' under Pyramid OSx 4.0 ucb universe.

Repeated by:
	make print.o

Reason:
	The following patch is for Pyramid OSx 4.0.  On Pyramid,
	/usr/include/sys/varargs.h has #defines that are specific
	to Pyramid.  The (incorrect?) use of va_start() and va_end()
	in file 'print.c' caused the failure.

Fixed by:
	Reorder the place where va_start(), va_end(). Essentially,
	they are now put at the beginning and the end of the function
	respectively.

*** print.c~	Mon Apr 18 00:54:25 1988
--- print.c	Thu Apr 21 18:59:49 1988
***************
*** 51,57
  	    _doprnt(fmt, args, stdout);
  #endif /* VPRINTF */
  	    fflush(stdout);
- 	    va_end(args);
  	    return;
  	}
  #ifdef VPRINTF

--- 51,56 -----
  	    _doprnt(fmt, args, stdout);
  #endif /* VPRINTF */
  	    fflush(stdout);
  	    return;
  	}
  #ifdef VPRINTF
***************
*** 66,72
  	*foo._ptr = '\0'; /* plant terminating null character */
      }
  #endif /* VPIRNTF */
-     va_end(args);
      p = msgbuf;
      if (iscurses || istool)
  	while (p = index(p, '\n'))

--- 65,70 -----
  	*foo._ptr = '\0'; /* plant terminating null character */
      }
  #endif /* VPIRNTF */
      p = msgbuf;
      if (iscurses || istool)
  	while (p = index(p, '\n'))
***************
*** 101,106
      x += strlen(msgbuf) * l_width(LARGE);
      Clrtoeol(print_win, x, l_height(LARGE), LARGE);
  #endif /* SUNTOOL */
  }
  #endif /* SUNTOOL || CURSES */
  

--- 99,105 -----
      x += strlen(msgbuf) * l_width(LARGE);
      Clrtoeol(print_win, x, l_height(LARGE), LARGE);
  #endif /* SUNTOOL */
+     va_end(args);
  }
  #endif /* SUNTOOL || CURSES */
  
***************
*** 125,131
  #else /* VPRINTF */
  	_doprnt(fmt, args, stdout);
  #endif /* VPRINTF */
- 	va_end(args);
  	fflush(stdout);
  	return;
      }

--- 124,129 -----
  #else /* VPRINTF */
  	_doprnt(fmt, args, stdout);
  #endif /* VPRINTF */
  	fflush(stdout);
  	return;
      }
***************
*** 141,146
      *foo._ptr = '\0'; /* plant terminating null character */
  #endif /* VPRINTF */
      Addstr(msgbuf);  /* addstr() will scroll if necessary */
  }
  
  /*

--- 139,145 -----
      *foo._ptr = '\0'; /* plant terminating null character */
  #endif /* VPRINTF */
      Addstr(msgbuf);  /* addstr() will scroll if necessary */
+     va_end(args);
  }
  
  /*
-- 
Paul Lew			{oliveb,harvard,decvax}!gsg!lew	(UUCP)
General Systems Group, 5 Manor Parkway, Salem, NH 03079	(603) 893-1000



More information about the Comp.sources.bugs mailing list