src/java.base/share/classes/java/util/jar/Manifest.java
changeset 50433 2bafeb7a1f6b
parent 50413 1234ff7199c7
child 51879 6ffa38b8da65
equal deleted inserted replaced
50432:3a91f09a46be 50433:2bafeb7a1f6b
   391                 n = tpos - pos;
   391                 n = tpos - pos;
   392                 System.arraycopy(tbuf, pos, b, off, n);
   392                 System.arraycopy(tbuf, pos, b, off, n);
   393                 off += n;
   393                 off += n;
   394                 total += n;
   394                 total += n;
   395                 pos = tpos;
   395                 pos = tpos;
   396                 if (c == '\n' || c == '\r') {
   396                 c = tbuf[tpos-1];
       
   397                 if (c == '\n') {
       
   398                     break;
       
   399                 }
       
   400                 if (c == '\r') {
       
   401                     if (count == pos) {
       
   402                         // try to see if there is a trailing LF
       
   403                         fill();
       
   404                         if (pos < count && tbuf[pos] == '\n') {
       
   405                             if (total < len) {
       
   406                                 b[off++] = '\n';
       
   407                                 total++;
       
   408                             } else {
       
   409                                 // we should always have big enough lbuf but
       
   410                                 // just in case we don't, replace the last CR
       
   411                                 // with LF.
       
   412                                 b[off - 1] = '\n';
       
   413                             }
       
   414                             pos++;
       
   415                         }
       
   416                     }
   397                     break;
   417                     break;
   398                 }
   418                 }
   399             }
   419             }
   400             return total;
   420             return total;
   401         }
   421         }