Fossil

Check-in [3920fa67]
Login

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

Overview
Comment:merge trunk

Fix continuation-byte check for UTF-8 chars > 2 bytes.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | improve_commit_warning
Files: files | file ages | folders
SHA1: 3920fa67bdae08fe6873ef84aac04128881968b1
User & Date: jan.nijtmans 2012-11-07 12:10:02
Context
2012-11-12
13:19
merge trunk check-in: aaa1cb04 user: jan.nijtmans tags: improve_commit_warning
2012-11-07
12:10
merge trunk

Fix continuation-byte check for UTF-8 chars > 2 bytes.

check-in: 3920fa67 user: jan.nijtmans tags: improve_commit_warning
11:28
Show an error message when trying to rename one file on top of another, rather than throwing a uniqueness constraint. Ticket [1e43138b8b8e90f] check-in: 14fdae7e user: drh tags: trunk
10:14
fix Abandoning warning check-in: 4d6ae5c0 user: jan.nijtmans tags: improve_commit_warning
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/add.c.

498
499
500
501
502
503
504










505
506
507
508
509
510
511

/*
** Rename a single file.
**
** The original name of the file is zOrig.  The new filename is zNew.
*/
static void mv_one_file(int vid, const char *zOrig, const char *zNew){










  fossil_print("RENAME %s %s\n", zOrig, zNew);
  db_multi_exec(
    "UPDATE vfile SET pathname='%q' WHERE pathname='%q' AND vid=%d",
    zNew, zOrig, vid
  );
}








>
>
>
>
>
>
>
>
>
>







498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521

/*
** Rename a single file.
**
** The original name of the file is zOrig.  The new filename is zNew.
*/
static void mv_one_file(int vid, const char *zOrig, const char *zNew){
  int x = db_int(-1, "SELECT deleted FROM vfile WHERE pathname=%Q", zNew);
  if( x>=0 ){
    if( x==0 ){
      fossil_fatal("cannot rename '%s' to '%s' since another file named '%s'"
                   " is currently under management", zOrig, zNew, zNew); 
    }else{
      fossil_fatal("cannot rename '%s' to '%s' since the delete of '%s' has "
                   "not yet been committed", zOrig, zNew, zNew);
    }
  }
  fossil_print("RENAME %s %s\n", zOrig, zNew);
  db_multi_exec(
    "UPDATE vfile SET pathname='%q' WHERE pathname='%q' AND vid=%d",
    zNew, zOrig, vid
  );
}

Changes to src/diff.c.

188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
}else do{ \
  /* Check if all continuation bytes >=0x80 and <0xC0 */ \
  if( n<2 || ((z[1]&0xC0)!=0x80) ){ \
    result |= 4; /* Invalid continuation byte, continue */ \
    break; \
  }else{ \
    /* prepare for checking remaining continuation bytes */ \
    c<<=2; --n; ++j; ++z; \
  } \
}while( c>=0xC0 );

/*
** This function attempts to scan each logical line within the blob to
** determine the type of content it appears to contain.  Possible return
** values are:







|







188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
}else do{ \
  /* Check if all continuation bytes >=0x80 and <0xC0 */ \
  if( n<2 || ((z[1]&0xC0)!=0x80) ){ \
    result |= 4; /* Invalid continuation byte, continue */ \
    break; \
  }else{ \
    /* prepare for checking remaining continuation bytes */ \
    c<<=1; --n; ++j; ++z; \
  } \
}while( c>=0xC0 );

/*
** This function attempts to scan each logical line within the blob to
** determine the type of content it appears to contain.  Possible return
** values are: