[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.49 and 1.50

version 1.49, 2009/06/04 23:39:37 version 1.50, 2012/04/12 04:47:59
Line 11 
Line 11 
   
 #include "def.h"  #include "def.h"
 #include "key.h"  #include "key.h"
 #ifndef NO_MACRO  
 #include "macro.h"  #include "macro.h"
 #endif /* !NO_MACRO */  
   
 #include "funmap.h"  #include "funmap.h"
   
Line 56 
Line 54 
 {  {
         int      s;          int      s;
   
 #ifndef NO_MACRO  
         if (inmacro)          if (inmacro)
                 return (TRUE);                  return (TRUE);
 #endif /* !NO_MACRO */  
         ewprintf("%s? (y or n) ", sp);          ewprintf("%s? (y or n) ", sp);
         for (;;) {          for (;;) {
                 s = getkey(FALSE);                  s = getkey(FALSE);
Line 83 
Line 80 
 {  {
         char     buf[64], *rep;          char     buf[64], *rep;
   
 #ifndef NO_MACRO  
         if (inmacro)          if (inmacro)
                 return (TRUE);                  return (TRUE);
 #endif /* !NO_MACRO */  
         rep = eread("%s? (yes or no) ", buf, sizeof(buf),          rep = eread("%s? (yes or no) ", buf, sizeof(buf),
             EFNUL | EFNEW | EFCR, sp);              EFNUL | EFNEW | EFCR, sp);
         for (;;) {          for (;;) {
                 if (rep == NULL)                  if (rep == NULL)
                         return (ABORT);                          return (ABORT);
                 if (rep[0] != '\0') {                  if (rep[0] != '\0') {
 #ifndef NO_MACRO  
                         if (macrodef) {                          if (macrodef) {
                                 struct line     *lp = maclcur;                                  struct line     *lp = maclcur;
   
Line 101 
Line 96 
                                 maclcur->l_fp = lp->l_fp;                                  maclcur->l_fp = lp->l_fp;
                                 free(lp);                                  free(lp);
                         }                          }
 #endif /* !NO_MACRO */  
                         if ((rep[0] == 'y' || rep[0] == 'Y') &&                          if ((rep[0] == 'y' || rep[0] == 'Y') &&
                             (rep[1] == 'e' || rep[1] == 'E') &&                              (rep[1] == 'e' || rep[1] == 'E') &&
                             (rep[2] == 's' || rep[2] == 'S') &&                              (rep[2] == 's' || rep[2] == 'S') &&
Line 158 
Line 152 
   
         static char emptyval[] = "";    /* XXX hackish way to return err msg*/          static char emptyval[] = "";    /* XXX hackish way to return err msg*/
   
 #ifndef NO_MACRO  
         if (inmacro) {          if (inmacro) {
                 if (dynbuf) {                  if (dynbuf) {
                         if ((buf = malloc(maclcur->l_used + 1)) == NULL)                          if ((buf = malloc(maclcur->l_used + 1)) == NULL)
Line 170 
Line 163 
                 maclcur = maclcur->l_fp;                  maclcur = maclcur->l_fp;
                 return (buf);                  return (buf);
         }          }
 #endif /* !NO_MACRO */  
         epos = cpos = 0;          epos = cpos = 0;
         ml = mr = esc = 0;          ml = mr = esc = 0;
         cplflag = FALSE;          cplflag = FALSE;
Line 344 
Line 336 
                                 ttputc(CCHR('M'));                                  ttputc(CCHR('M'));
                                 ttflush();                                  ttflush();
                         }                          }
 #ifndef NO_MACRO  
                         if (macrodef) {                          if (macrodef) {
                                 struct line     *lp;                                  struct line     *lp;
   
Line 356 
Line 347 
                                 maclcur = lp;                                  maclcur = lp;
                                 bcopy(buf, lp->l_text, cpos);                                  bcopy(buf, lp->l_text, cpos);
                         }                          }
 #endif /* !NO_MACRO */  
                         ret = buf;                          ret = buf;
                         goto done;                          goto done;
                 case CCHR('G'):                 /* bell, abort */                  case CCHR('G'):                 /* bell, abort */
Line 779 
Line 769 
 {  {
         va_list  ap;          va_list  ap;
   
 #ifndef NO_MACRO  
         if (inmacro)          if (inmacro)
                 return;                  return;
 #endif /* !NO_MACRO */  
         va_start(ap, fmt);          va_start(ap, fmt);
         ttcolor(CTEXT);          ttcolor(CTEXT);
         ttmove(nrow - 1, 0);          ttmove(nrow - 1, 0);

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.50