Fossil SCM

Comment updates.

stephan 2020-05-02 17:41 UTC checkin-without-checkout
Commit 43d6e3caf2dc5d5408c323fa9ece16366db90c49e3f11ab02d673897860325b4
1 file changed +5 -13
+5 -13
--- src/checkin.c
+++ src/checkin.c
@@ -3247,24 +3247,16 @@
32473247
if(((CIMINI_CONVERT_EOL_INHERIT & pCI->flags)
32483248
|| (CIMINI_CONVERT_EOL_UNIX & pCI->flags)
32493249
|| (CIMINI_CONVERT_EOL_WINDOWS & pCI->flags))
32503250
&& blob_size(&pCI->fileContent)>0
32513251
){
3252
- /* Confirm that the new content has the same EOL style as its
3253
- ** predecessor and convert it, if needed, to the same style. Note
3254
- ** that this inherently runs a risk of breaking content,
3255
- ** e.g. string literals which contain embedded newlines. Note that
3256
- ** HTML5 specifies that form-submitted TEXTAREA content gets
3257
- ** normalized to CRLF-style:
3252
+ /* Convert to the requested EOL style. Note that this inherently
3253
+ ** runs a risk of breaking content, e.g. string literals which
3254
+ ** contain embedded newlines. Note that HTML5 specifies that
3255
+ ** form-submitted TEXTAREA content gets normalized to CRLF-style:
32583256
**
32593257
** https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element
3260
- **
3261
- ** More performant/efficient would be to offer a flag which says
3262
- ** which newline form to use, converting the new copy (if needed)
3263
- ** without having to examine the original. Since the primary use
3264
- ** case is a web interface, it would be easy to offer it as a
3265
- ** checkbox there.
32663258
*/
32673259
const int pseudoBinary = LOOK_LONG | LOOK_NUL;
32683260
const int lookFlags = LOOK_CRLF | pseudoBinary;
32693261
const int lookNew = looks_like_utf8( &pCI->fileContent, lookFlags );
32703262
if(!(pseudoBinary & lookNew)){
@@ -3295,12 +3287,12 @@
32953287
}else{
32963288
const int oldSize = blob_size(&pCI->fileContent);
32973289
if(CIMINI_CONVERT_EOL_UNIX & pCI->flags){
32983290
blob_to_lf_only(&pCI->fileContent);
32993291
}else{
3300
- blob_add_cr(&pCI->fileContent);
33013292
assert(CIMINI_CONVERT_EOL_WINDOWS & pCI->flags);
3293
+ blob_add_cr(&pCI->fileContent);
33023294
}
33033295
if(blob_size(&pCI->fileContent)!=oldSize){
33043296
rehash = 1;
33053297
}
33063298
}
33073299
--- src/checkin.c
+++ src/checkin.c
@@ -3247,24 +3247,16 @@
3247 if(((CIMINI_CONVERT_EOL_INHERIT & pCI->flags)
3248 || (CIMINI_CONVERT_EOL_UNIX & pCI->flags)
3249 || (CIMINI_CONVERT_EOL_WINDOWS & pCI->flags))
3250 && blob_size(&pCI->fileContent)>0
3251 ){
3252 /* Confirm that the new content has the same EOL style as its
3253 ** predecessor and convert it, if needed, to the same style. Note
3254 ** that this inherently runs a risk of breaking content,
3255 ** e.g. string literals which contain embedded newlines. Note that
3256 ** HTML5 specifies that form-submitted TEXTAREA content gets
3257 ** normalized to CRLF-style:
3258 **
3259 ** https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element
3260 **
3261 ** More performant/efficient would be to offer a flag which says
3262 ** which newline form to use, converting the new copy (if needed)
3263 ** without having to examine the original. Since the primary use
3264 ** case is a web interface, it would be easy to offer it as a
3265 ** checkbox there.
3266 */
3267 const int pseudoBinary = LOOK_LONG | LOOK_NUL;
3268 const int lookFlags = LOOK_CRLF | pseudoBinary;
3269 const int lookNew = looks_like_utf8( &pCI->fileContent, lookFlags );
3270 if(!(pseudoBinary & lookNew)){
@@ -3295,12 +3287,12 @@
3295 }else{
3296 const int oldSize = blob_size(&pCI->fileContent);
3297 if(CIMINI_CONVERT_EOL_UNIX & pCI->flags){
3298 blob_to_lf_only(&pCI->fileContent);
3299 }else{
3300 blob_add_cr(&pCI->fileContent);
3301 assert(CIMINI_CONVERT_EOL_WINDOWS & pCI->flags);
 
3302 }
3303 if(blob_size(&pCI->fileContent)!=oldSize){
3304 rehash = 1;
3305 }
3306 }
3307
--- src/checkin.c
+++ src/checkin.c
@@ -3247,24 +3247,16 @@
3247 if(((CIMINI_CONVERT_EOL_INHERIT & pCI->flags)
3248 || (CIMINI_CONVERT_EOL_UNIX & pCI->flags)
3249 || (CIMINI_CONVERT_EOL_WINDOWS & pCI->flags))
3250 && blob_size(&pCI->fileContent)>0
3251 ){
3252 /* Convert to the requested EOL style. Note that this inherently
3253 ** runs a risk of breaking content, e.g. string literals which
3254 ** contain embedded newlines. Note that HTML5 specifies that
3255 ** form-submitted TEXTAREA content gets normalized to CRLF-style:
 
 
3256 **
3257 ** https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element
 
 
 
 
 
 
3258 */
3259 const int pseudoBinary = LOOK_LONG | LOOK_NUL;
3260 const int lookFlags = LOOK_CRLF | pseudoBinary;
3261 const int lookNew = looks_like_utf8( &pCI->fileContent, lookFlags );
3262 if(!(pseudoBinary & lookNew)){
@@ -3295,12 +3287,12 @@
3287 }else{
3288 const int oldSize = blob_size(&pCI->fileContent);
3289 if(CIMINI_CONVERT_EOL_UNIX & pCI->flags){
3290 blob_to_lf_only(&pCI->fileContent);
3291 }else{
 
3292 assert(CIMINI_CONVERT_EOL_WINDOWS & pCI->flags);
3293 blob_add_cr(&pCI->fileContent);
3294 }
3295 if(blob_size(&pCI->fileContent)!=oldSize){
3296 rehash = 1;
3297 }
3298 }
3299

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button