[BACK]Return to echo.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/echo.c between version 1.39 and 1.40

version 1.39, 2005/11/11 18:40:51 version 1.40, 2005/11/18 20:56:52
Line 28 
Line 28 
 static void      eputl(long, int);  static void      eputl(long, int);
 static void      eputs(const char *);  static void      eputs(const char *);
 static void      eputc(char);  static void      eputc(char);
 static LIST     *copy_list(LIST *);  static struct list      *copy_list(struct list *);
   
 int             epresf = FALSE;         /* stuff in echo line flag */  int             epresf = FALSE;         /* stuff in echo line flag */
   
Line 95 
Line 95 
                 if (rep[0] != '\0') {                  if (rep[0] != '\0') {
 #ifndef NO_MACRO  #ifndef NO_MACRO
                         if (macrodef) {                          if (macrodef) {
                                 LINE    *lp = maclcur;                                  struct line     *lp = maclcur;
   
                                 maclcur = lp->l_bp;                                  maclcur = lp->l_bp;
                                 maclcur->l_fp = lp->l_fp;                                  maclcur->l_fp = lp->l_fp;
Line 150 
Line 150 
         int      mr = 0;                /* match left arrow */          int      mr = 0;                /* match left arrow */
         int      ml = 0;                /* match right arrow */          int      ml = 0;                /* match right arrow */
         int      esc = 0;               /* position in esc pattern */          int      esc = 0;               /* position in esc pattern */
         BUFFER  *bp;                    /* completion list buffer */          struct buffer   *bp;                    /* completion list buffer */
         MGWIN   *wp;                    /* window for compl list */          struct mgwin    *wp;                    /* window for compl list */
         int      match;                 /* esc match found */          int      match;                 /* esc match found */
         int      cc, rr;                /* saved ttcol, ttrow */          int      cc, rr;                /* saved ttcol, ttrow */
         char    *ret;                   /* return value */          char    *ret;                   /* return value */
Line 340 
Line 340 
                         }                          }
 #ifndef NO_MACRO  #ifndef NO_MACRO
                         if (macrodef) {                          if (macrodef) {
                                 LINE    *lp;                                  struct line     *lp;
   
                                 if ((lp = lalloc(cpos)) == NULL) {                                  if ((lp = lalloc(cpos)) == NULL) {
                                         static char falseval[] = "";                                          static char falseval[] = "";
Line 488 
Line 488 
 static int  static int
 complt(int flags, int c, char *buf, size_t nbuf, int cpos, int *nx)  complt(int flags, int c, char *buf, size_t nbuf, int cpos, int *nx)
 {  {
         LIST    *lh, *lh2;          struct list     *lh, *lh2;
         LIST    *wholelist = NULL;          struct list     *wholelist = NULL;
         int      i, nxtra, nhits, bxtra, msglen, nshown;          int      i, nxtra, nhits, bxtra, msglen, nshown;
         int      wflag = FALSE;          int      wflag = FALSE;
         char    *msg;          char    *msg;
Line 585 
Line 585 
 static int  static int
 complt_list(int flags, int c, char *buf, int cpos)  complt_list(int flags, int c, char *buf, int cpos)
 {  {
         LIST    *lh, *lh2, *lh3;          struct list     *lh, *lh2, *lh3;
         LIST    *wholelist = NULL;          struct list     *wholelist = NULL;
         BUFFER  *bp;          struct buffer   *bp;
         int      i, maxwidth, width;          int      i, maxwidth, width;
         int      preflen = 0;          int      preflen = 0;
         int      oldrow = ttrow;          int      oldrow = ttrow;
Line 738 
Line 738 
  * this is normal.   * this is normal.
  */   */
 int  int
 getxtra(LIST *lp1, LIST *lp2, int cpos, int wflag)  getxtra(struct list *lp1, struct list *lp2, int cpos, int wflag)
 {  {
         int     i;          int     i;
   
Line 918 
Line 918 
 }  }
   
 void  void
 free_file_list(LIST *lp)  free_file_list(struct list *lp)
 {  {
         LIST    *next;          struct list     *next;
   
         while (lp) {          while (lp) {
                 next = lp->l_next;                  next = lp->l_next;
Line 929 
Line 929 
         }          }
 }  }
   
 static LIST *  static struct list *
 copy_list(LIST *lp)  copy_list(struct list *lp)
 {  {
         LIST    *current, *last, *nxt;          struct list     *current, *last, *nxt;
   
         last = NULL;          last = NULL;
         while (lp) {          while (lp) {
                 current = (LIST *)malloc(sizeof(LIST));                  current = (struct list *)malloc(sizeof(struct list));
                 if (current == NULL) {                  if (current == NULL) {
                         for (current = last; current; current = nxt) {                          for (current = last; current; current = nxt) {
                                 nxt = current->l_next;                                  nxt = current->l_next;

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40