575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
|
** contain embedded newlines. Note that HTML5 specifies that
** form-submitted TEXTAREA content gets normalized to CRLF-style:
**
** https://html.spec.whatwg.org/#the-textarea-element
*/
const int pseudoBinary = LOOK_LONG | LOOK_NUL;
const int lookFlags = LOOK_CRLF | LOOK_LONE_LF | pseudoBinary;
const int lookNew = looks_like_utf8( &pCI->fileContent, lookFlags );
if(!(pseudoBinary & lookNew)){
int rehash = 0;
/*fossil_print("lookNew=%08x\n",lookNew);*/
if(CIMINI_CONVERT_EOL_INHERIT & pCI->flags){
Blob contentPrev = empty_blob;
int lookOrig, nOrig;
content_get(prevFRid, &contentPrev);
lookOrig = looks_like_utf8(&contentPrev, lookFlags);
nOrig = blob_size(&contentPrev);
blob_reset(&contentPrev);
/*fossil_print("lookOrig=%08x\n",lookOrig);*/
if(nOrig>0 && lookOrig!=lookNew){
/* If there is a newline-style mismatch, adjust the new
** content version to the previous style, then re-hash the
** content. Note that this means that what we insert is NOT
|
|
|
|
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
|
** contain embedded newlines. Note that HTML5 specifies that
** form-submitted TEXTAREA content gets normalized to CRLF-style:
**
** https://html.spec.whatwg.org/#the-textarea-element
*/
const int pseudoBinary = LOOK_LONG | LOOK_NUL;
const int lookFlags = LOOK_CRLF | LOOK_LONE_LF | pseudoBinary;
const int lookNew = looks_like_utf8( &pCI->fileContent, lookFlags, 0 );
if(!(pseudoBinary & lookNew)){
int rehash = 0;
/*fossil_print("lookNew=%08x\n",lookNew);*/
if(CIMINI_CONVERT_EOL_INHERIT & pCI->flags){
Blob contentPrev = empty_blob;
int lookOrig, nOrig;
content_get(prevFRid, &contentPrev);
lookOrig = looks_like_utf8(&contentPrev, lookFlags, 0);
nOrig = blob_size(&contentPrev);
blob_reset(&contentPrev);
/*fossil_print("lookOrig=%08x\n",lookOrig);*/
if(nOrig>0 && lookOrig!=lookNew){
/* If there is a newline-style mismatch, adjust the new
** content version to the previous style, then re-hash the
** content. Note that this means that what we insert is NOT
|