Fossil SCM

LOOK_LENGTH flags only has meaning when LOOK_NUL is not set.

jan.nijtmans 2013-03-14 13:51 trunk
Commit 8923e06ceabd4d63ed3e8a7390b6846df1502efe
2 files changed +1 -3 +1 -1
+1 -3
--- src/checkin.c
+++ src/checkin.c
@@ -909,11 +909,10 @@
909909
){
910910
int eType; /* return value of looks_like_utf8/utf16() */
911911
int fUnicode; /* return value of starts_with_utf16_bom() */
912912
int lookFlags; /* output flags from looks_like_utf8/utf16() */
913913
int fHasCrLf; /* the blob contains one or more CR/LF pairs */
914
- int fHasLength; /* the blob contains an overly long line */
915914
char *zMsg; /* Warning message */
916915
Blob fname; /* Relative pathname of the file */
917916
static int allOk = 0; /* Set to true to disable this routine */
918917
919918
if( allOk ) return 0;
@@ -928,11 +927,10 @@
928927
}
929928
}else{
930929
eType = looks_like_utf8(p, &lookFlags);
931930
}
932931
fHasCrLf = (lookFlags & LOOK_CRLF);
933
- fHasLength = (lookFlags & LOOK_LENGTH);
934932
if( eType==0 || fHasCrLf || fUnicode ){
935933
const char *zWarning;
936934
const char *zDisable;
937935
const char *zConvert = "c=convert/";
938936
Blob ans;
@@ -940,11 +938,11 @@
940938
941939
if( eType==0 ){
942940
if( binOk ){
943941
return 0; /* We don't want binary warnings for this file. */
944942
}
945
- if( fHasLength ){
943
+ if( lookFlags&(LOOK_LENGTH) && !lookFlags&(LOOK_NUL) ){
946944
zWarning = "long lines";
947945
}else{
948946
zWarning = "binary data";
949947
}
950948
zDisable = "\"binary-glob\" setting";
951949
--- 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 @@
7070
** to convey status information about the blob content.
7171
*/
7272
#define LOOK_NONE ((int)0x00000000) /* Nothing special was found. */
7373
#define LOOK_NUL ((int)0x00000001) /* One or more NUL chars were found. */
7474
#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. */
7676
#define LOOK_CRLF ((int)0x00000008) /* One or more CR/LF pairs were found. */
7777
#define LOOK_LENGTH ((int)0x00000010) /* An over length line was found. */
7878
#define LOOK_ODD ((int)0x00000020) /* An odd number of bytes was found. */
7979
#define LOOK_CR (LOOK_LONE_CR|LOOK_CRLF) /* One or more CR chars were found. */
8080
#define LOOK_LF (LOOK_LONE_LF|LOOK_CRLF) /* One or more LF chars were found. */
8181
--- 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

Keyboard Shortcuts

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