Fossil SCM
LOOK_LENGTH flags only has meaning when LOOK_NUL is not set.
Commit
8923e06ceabd4d63ed3e8a7390b6846df1502efe
Parent
bd1dcc1c526565c…
2 files changed
+1
-3
+1
-1
+1
-3
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -909,11 +909,10 @@ | ||
| 909 | 909 | ){ |
| 910 | 910 | int eType; /* return value of looks_like_utf8/utf16() */ |
| 911 | 911 | int fUnicode; /* return value of starts_with_utf16_bom() */ |
| 912 | 912 | int lookFlags; /* output flags from looks_like_utf8/utf16() */ |
| 913 | 913 | int fHasCrLf; /* the blob contains one or more CR/LF pairs */ |
| 914 | - int fHasLength; /* the blob contains an overly long line */ | |
| 915 | 914 | char *zMsg; /* Warning message */ |
| 916 | 915 | Blob fname; /* Relative pathname of the file */ |
| 917 | 916 | static int allOk = 0; /* Set to true to disable this routine */ |
| 918 | 917 | |
| 919 | 918 | if( allOk ) return 0; |
| @@ -928,11 +927,10 @@ | ||
| 928 | 927 | } |
| 929 | 928 | }else{ |
| 930 | 929 | eType = looks_like_utf8(p, &lookFlags); |
| 931 | 930 | } |
| 932 | 931 | fHasCrLf = (lookFlags & LOOK_CRLF); |
| 933 | - fHasLength = (lookFlags & LOOK_LENGTH); | |
| 934 | 932 | if( eType==0 || fHasCrLf || fUnicode ){ |
| 935 | 933 | const char *zWarning; |
| 936 | 934 | const char *zDisable; |
| 937 | 935 | const char *zConvert = "c=convert/"; |
| 938 | 936 | Blob ans; |
| @@ -940,11 +938,11 @@ | ||
| 940 | 938 | |
| 941 | 939 | if( eType==0 ){ |
| 942 | 940 | if( binOk ){ |
| 943 | 941 | return 0; /* We don't want binary warnings for this file. */ |
| 944 | 942 | } |
| 945 | - if( fHasLength ){ | |
| 943 | + if( lookFlags&(LOOK_LENGTH) && !lookFlags&(LOOK_NUL) ){ | |
| 946 | 944 | zWarning = "long lines"; |
| 947 | 945 | }else{ |
| 948 | 946 | zWarning = "binary data"; |
| 949 | 947 | } |
| 950 | 948 | zDisable = "\"binary-glob\" setting"; |
| 951 | 949 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -909,11 +909,10 @@ | |
| 909 | ){ |
| 910 | int eType; /* return value of looks_like_utf8/utf16() */ |
| 911 | int fUnicode; /* return value of starts_with_utf16_bom() */ |
| 912 | int lookFlags; /* output flags from looks_like_utf8/utf16() */ |
| 913 | int fHasCrLf; /* the blob contains one or more CR/LF pairs */ |
| 914 | int fHasLength; /* the blob contains an overly long line */ |
| 915 | char *zMsg; /* Warning message */ |
| 916 | Blob fname; /* Relative pathname of the file */ |
| 917 | static int allOk = 0; /* Set to true to disable this routine */ |
| 918 | |
| 919 | if( allOk ) return 0; |
| @@ -928,11 +927,10 @@ | |
| 928 | } |
| 929 | }else{ |
| 930 | eType = looks_like_utf8(p, &lookFlags); |
| 931 | } |
| 932 | fHasCrLf = (lookFlags & LOOK_CRLF); |
| 933 | fHasLength = (lookFlags & LOOK_LENGTH); |
| 934 | if( eType==0 || fHasCrLf || fUnicode ){ |
| 935 | const char *zWarning; |
| 936 | const char *zDisable; |
| 937 | const char *zConvert = "c=convert/"; |
| 938 | Blob ans; |
| @@ -940,11 +938,11 @@ | |
| 940 | |
| 941 | if( eType==0 ){ |
| 942 | if( binOk ){ |
| 943 | return 0; /* We don't want binary warnings for this file. */ |
| 944 | } |
| 945 | if( fHasLength ){ |
| 946 | zWarning = "long lines"; |
| 947 | }else{ |
| 948 | zWarning = "binary data"; |
| 949 | } |
| 950 | zDisable = "\"binary-glob\" setting"; |
| 951 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -909,11 +909,10 @@ | |
| 909 | ){ |
| 910 | int eType; /* return value of looks_like_utf8/utf16() */ |
| 911 | int fUnicode; /* return value of starts_with_utf16_bom() */ |
| 912 | int lookFlags; /* output flags from looks_like_utf8/utf16() */ |
| 913 | int fHasCrLf; /* the blob contains one or more CR/LF pairs */ |
| 914 | char *zMsg; /* Warning message */ |
| 915 | Blob fname; /* Relative pathname of the file */ |
| 916 | static int allOk = 0; /* Set to true to disable this routine */ |
| 917 | |
| 918 | if( allOk ) return 0; |
| @@ -928,11 +927,10 @@ | |
| 927 | } |
| 928 | }else{ |
| 929 | eType = looks_like_utf8(p, &lookFlags); |
| 930 | } |
| 931 | fHasCrLf = (lookFlags & LOOK_CRLF); |
| 932 | if( eType==0 || fHasCrLf || fUnicode ){ |
| 933 | const char *zWarning; |
| 934 | const char *zDisable; |
| 935 | const char *zConvert = "c=convert/"; |
| 936 | Blob ans; |
| @@ -940,11 +938,11 @@ | |
| 938 | |
| 939 | if( eType==0 ){ |
| 940 | if( binOk ){ |
| 941 | return 0; /* We don't want binary warnings for this file. */ |
| 942 | } |
| 943 | if( lookFlags&(LOOK_LENGTH) && !lookFlags&(LOOK_NUL) ){ |
| 944 | zWarning = "long lines"; |
| 945 | }else{ |
| 946 | zWarning = "binary data"; |
| 947 | } |
| 948 | zDisable = "\"binary-glob\" setting"; |
| 949 |
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -70,11 +70,11 @@ | ||
| 70 | 70 | ** to convey status information about the blob content. |
| 71 | 71 | */ |
| 72 | 72 | #define LOOK_NONE ((int)0x00000000) /* Nothing special was found. */ |
| 73 | 73 | #define LOOK_NUL ((int)0x00000001) /* One or more NUL chars were found. */ |
| 74 | 74 | #define LOOK_LONE_CR ((int)0x00000002) /* An unpaired CR char was found. */ |
| 75 | -#define LOOK_LONE_LF ((int)0x00000004) /* An unpaired CR char was found. */ | |
| 75 | +#define LOOK_LONE_LF ((int)0x00000004) /* An unpaired LF char was found. */ | |
| 76 | 76 | #define LOOK_CRLF ((int)0x00000008) /* One or more CR/LF pairs were found. */ |
| 77 | 77 | #define LOOK_LENGTH ((int)0x00000010) /* An over length line was found. */ |
| 78 | 78 | #define LOOK_ODD ((int)0x00000020) /* An odd number of bytes was found. */ |
| 79 | 79 | #define LOOK_CR (LOOK_LONE_CR|LOOK_CRLF) /* One or more CR chars were found. */ |
| 80 | 80 | #define LOOK_LF (LOOK_LONE_LF|LOOK_CRLF) /* One or more LF chars were found. */ |
| 81 | 81 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -70,11 +70,11 @@ | |
| 70 | ** to convey status information about the blob content. |
| 71 | */ |
| 72 | #define LOOK_NONE ((int)0x00000000) /* Nothing special was found. */ |
| 73 | #define LOOK_NUL ((int)0x00000001) /* One or more NUL chars were found. */ |
| 74 | #define LOOK_LONE_CR ((int)0x00000002) /* An unpaired CR char was found. */ |
| 75 | #define LOOK_LONE_LF ((int)0x00000004) /* An unpaired CR char was found. */ |
| 76 | #define LOOK_CRLF ((int)0x00000008) /* One or more CR/LF pairs were found. */ |
| 77 | #define LOOK_LENGTH ((int)0x00000010) /* An over length line was found. */ |
| 78 | #define LOOK_ODD ((int)0x00000020) /* An odd number of bytes was found. */ |
| 79 | #define LOOK_CR (LOOK_LONE_CR|LOOK_CRLF) /* One or more CR chars were found. */ |
| 80 | #define LOOK_LF (LOOK_LONE_LF|LOOK_CRLF) /* One or more LF chars were found. */ |
| 81 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -70,11 +70,11 @@ | |
| 70 | ** to convey status information about the blob content. |
| 71 | */ |
| 72 | #define LOOK_NONE ((int)0x00000000) /* Nothing special was found. */ |
| 73 | #define LOOK_NUL ((int)0x00000001) /* One or more NUL chars were found. */ |
| 74 | #define LOOK_LONE_CR ((int)0x00000002) /* An unpaired CR char was found. */ |
| 75 | #define LOOK_LONE_LF ((int)0x00000004) /* An unpaired LF char was found. */ |
| 76 | #define LOOK_CRLF ((int)0x00000008) /* One or more CR/LF pairs were found. */ |
| 77 | #define LOOK_LENGTH ((int)0x00000010) /* An over length line was found. */ |
| 78 | #define LOOK_ODD ((int)0x00000020) /* An odd number of bytes was found. */ |
| 79 | #define LOOK_CR (LOOK_LONE_CR|LOOK_CRLF) /* One or more CR chars were found. */ |
| 80 | #define LOOK_LF (LOOK_LONE_LF|LOOK_CRLF) /* One or more LF chars were found. */ |
| 81 |