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

Diff for /src/usr.bin/sendbug/sendbug.c between version 1.54 and 1.55

version 1.54, 2008/01/04 00:50:09 version 1.55, 2008/04/19 09:22:31
Line 433 
Line 433 
                 return (-1);                  return (-1);
         lbuf = NULL;          lbuf = NULL;
         while ((buf = fgetln(fp, &len))) {          while ((buf = fgetln(fp, &len))) {
                 if (buf[len - 1] == '\n')                  if (buf[len - 1] == '\n') {
                         buf[len - 1] = '\0';                          buf[len - 1] = '\0';
                 else {                          --len;
                   } else {
                         /* EOF without EOL, copy and add the NUL */                          /* EOF without EOL, copy and add the NUL */
                         if ((lbuf = malloc(len + 1)) == NULL)                          if ((lbuf = malloc(len + 1)) == NULL)
                                 goto end;                                  goto end;
Line 468 
Line 469 
                                 copylen = sp - buf;                                  copylen = sp - buf;
                         else                          else
                                 copylen = len;                                  copylen = len;
                         if (atomicio(vwrite, dst, buf, copylen) != copylen ||                          if (atomicio(vwrite, dst, buf, copylen) != copylen)
                             atomicio(vwrite, dst, "\n", 1) != 1)  
                                 goto end;                                  goto end;
                         if (!ep)                          if (!ep)
                                 break;                                  break;
Line 477 
Line 477 
                         len -= ep - buf + 1;                          len -= ep - buf + 1;
                         buf = ep + 1;                          buf = ep + 1;
                 }                  }
                   if (atomicio(vwrite, dst, "\n", 1) != 1)
                           goto end;
         }          }
         rval = 0;          rval = 0;
  end:   end:

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55