Fossil

Check-in [886e1bb2a8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Eliminate "continue" statement, makes control flow easier to understand. If we already know a character is non-ASCII, don't need to check for '\\' any more.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 886e1bb2a8ed8e134f105ea66c37bf69ec671978
User & Date: jan.nijtmans 2013-01-15 10:15:54.952
Context
2013-01-15
10:21
one more: if we already know the character is in the range U+E000 - U+FFFF, it cannot be a surrogate any more. check-in: 4f510b66cb user: jan.nijtmans tags: trunk
10:17
merge trunk check-in: 15fec2830e user: jan.nijtmans tags: allow-backslash-in-card-filename
10:15
Eliminate "continue" statement, makes control flow easier to understand. If we already know a character is non-ASCII, don't need to check for '\\' any more. check-in: 886e1bb2a8 user: jan.nijtmans tags: trunk
03:02
Ticket enhancements: Add the TICKET.TKT_CTIME field and make it hold the creation time of the ticket. Make sure that a TICKETCHNG entry is created for each change to the ticket if the TICKETCHNG.TKT_RID field exists. check-in: 8554d3e656 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/file.c.
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525

526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
         */
        return 0;
      }
      if( (c & 0xf0) == 0xe0 ) {
        /* This is a 3-byte UTF-8 character */
        if ( (c & 0xfe) == 0xee ){
          /* Range U+E000 - U+FFFF (Starting with 0xee or 0xef in UTF-8 ) */
          if ( (c & 1) && ((z[i+1] & 0xff) >= 0xa4) ){
            /* But exclude U+F900 - U+FFFF (0xef followed by byte >= 0xa4),
             * which contain valid characters. */
            continue;
          }
          /* Unicode character in the range U+E000 - U+F8FF are for
           * private use, they shouldn't occur in filenames.  */
          return 0;

        }
        if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){
          /* Unicode character in the range U+D800 - U+DFFF are for
           * surrogate pairs, they shouldn't occur in filenames. */
          return 0;
        }
      }
    }
    if( c=='\\' ){
      return 0;
    }
    if( c=='/' ){
      if( z[i+1]=='/' ) return 0;
      if( z[i+1]=='.' ){
        if( z[i+2]=='/' || z[i+2]==0 ) return 0;
        if( z[i+2]=='.' && (z[i+3]=='/' || z[i+3]==0) ) return 0;







|
<
<
<
<
|
|
|
>







<
|







511
512
513
514
515
516
517
518




519
520
521
522
523
524
525
526
527
528
529

530
531
532
533
534
535
536
537
         */
        return 0;
      }
      if( (c & 0xf0) == 0xe0 ) {
        /* This is a 3-byte UTF-8 character */
        if ( (c & 0xfe) == 0xee ){
          /* Range U+E000 - U+FFFF (Starting with 0xee or 0xef in UTF-8 ) */
          if ( !(c & 1) || ((z[i+1] & 0xff) < 0xa4) ){




            /* Unicode character in the range U+E000 - U+F8FF are for
             * private use, they shouldn't occur in filenames.  */
            return 0;
          }
        }
        if( ((c & 0xff) == 0xed) && ((z[i+1] & 0xe0) == 0xa0) ){
          /* Unicode character in the range U+D800 - U+DFFF are for
           * surrogate pairs, they shouldn't occur in filenames. */
          return 0;
        }
      }

    }else if( c=='\\' ){
      return 0;
    }
    if( c=='/' ){
      if( z[i+1]=='/' ) return 0;
      if( z[i+1]=='.' ){
        if( z[i+2]=='/' || z[i+2]==0 ) return 0;
        if( z[i+2]=='.' && (z[i+3]=='/' || z[i+3]==0) ) return 0;