Fossil

Check-in [64fc6d15]
Login

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

Overview
Comment:Fix a harmless valgrind warning in the tarball generator.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 64fc6d15e5a3fdc565e3b7eaf6d3cf902d5feff9
User & Date: drh 2014-01-11 19:11:27
Context
2014-01-11
20:39
Prevent buffer overruns when trying to do side-by-side diff alignment of lines that contain non-UTF8 characters and a prefix match. check-in: 37ffaaa9 user: drh tags: trunk
20:38
Fix incorrect link check-in: 27a843d2 user: jan.nijtmans tags: trunk
19:11
Fix a harmless valgrind warning in the tarball generator. check-in: 64fc6d15 user: drh tags: trunk
18:56
Fix the test/valgrind-www.tcl script so that it works on Ubuntu 13.10. check-in: fcfe117b user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/tar.c.

334
335
336
337
338
339
340
341
342

343
344
345
346
347
348
349
  const char *zName,      /* Name of directory including final "/" */
  int nName,              /* Characters in zName */
  unsigned int mTime      /* Modification time */
){
  int i;
  for(i=nName-1; i>0 && zName[i]!='/'; i--){}
  if( i<=0 ) return;
  if( i < tball.nPrevDirAlloc && tball.zPrevDir[i]==0 &&
        memcmp(tball.zPrevDir, zName, i)==0 ) return;

  db_multi_exec("INSERT OR IGNORE INTO dir VALUES('%#q')", i, zName);
  if( sqlite3_changes(g.db)==0 ) return;
  tar_add_directory_of(zName, i-1, mTime);
  tar_add_header(zName, i, 0755, mTime, 0, '5');
  if( i >= tball.nPrevDirAlloc ){
    int nsize = tball.nPrevDirAlloc * 2;
    if(i+1 > nsize)







|
|
>







334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
  const char *zName,      /* Name of directory including final "/" */
  int nName,              /* Characters in zName */
  unsigned int mTime      /* Modification time */
){
  int i;
  for(i=nName-1; i>0 && zName[i]!='/'; i--){}
  if( i<=0 ) return;
  if( i<tball.nPrevDirAlloc 
   && strncmp(tball.zPrevDir, zName, i)==0
   && tball.zPrevDir[i]==0 ) return;
  db_multi_exec("INSERT OR IGNORE INTO dir VALUES('%#q')", i, zName);
  if( sqlite3_changes(g.db)==0 ) return;
  tar_add_directory_of(zName, i-1, mTime);
  tar_add_header(zName, i, 0755, mTime, 0, '5');
  if( i >= tball.nPrevDirAlloc ){
    int nsize = tball.nPrevDirAlloc * 2;
    if(i+1 > nsize)