Fossil

Check-in [e5e6ca4659]
Login

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

Overview
Comment:Always use the alternate-form flag "#" to control the number of input bytes to printf conversions like %t, %h, and %q. Do not use precision in those cases since precision limits the number of output characters, not the number of input characters. Ticket [8967ea1df4f51af].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e5e6ca46597a50d215fa08a6ef1bd7b7939e3dea
User & Date: drh 2011-05-31 12:52:59.570
References
2011-05-31
12:58 Fixed ticket [8967ea1df4]: i18n, webui: link to tag with non-ascii chars is broken in timeline plus 2 other changes ... (artifact: 1dffb65b27 user: drh)
Context
2011-06-01
22:32
In contexts where only a check-out makes since, only resolve tags or branch names into check-outs, not events or other artifacts. Ticket [5f611295e3c2a8]. ... (check-in: 2a013f0228 user: drh tags: trunk)
2011-05-31
12:52
Always use the alternate-form flag "#" to control the number of input bytes to printf conversions like %t, %h, and %q. Do not use precision in those cases since precision limits the number of output characters, not the number of input characters. Ticket [8967ea1df4f51af]. ... (check-in: e5e6ca4659 user: drh tags: trunk)
2011-05-30
16:46
Makefile which works under the BSDs and Solaris using their non-GNU make. Resolves [5a96dd5f52]. ... (check-in: 3abab7e177 user: ben tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/glob.c.
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
    }else{
      cTerm = ',';
    }
    for(i=0; zGlobList[i] && zGlobList[i]!=cTerm; i++){}
    if( cTerm==',' ){
      while( i>0 && fossil_isspace(zGlobList[i-1]) ){ i--; }
    }
    blob_appendf(&expr, "%s%s GLOB '%.*q'", zSep, zVal, i, zGlobList);
    zSep = " OR ";
    if( cTerm!=',' && zGlobList[i] ) i++;
    zGlobList += i;
    if( zGlobList[0] ) zGlobList++;
    nTerm++;
  }
  if( nTerm ){







|







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
    }else{
      cTerm = ',';
    }
    for(i=0; zGlobList[i] && zGlobList[i]!=cTerm; i++){}
    if( cTerm==',' ){
      while( i>0 && fossil_isspace(zGlobList[i-1]) ){ i--; }
    }
    blob_appendf(&expr, "%s%s GLOB '%#q'", zSep, zVal, i, zGlobList);
    zSep = " OR ";
    if( cTerm!=',' && zGlobList[i] ) i++;
    zGlobList += i;
    if( zGlobList[0] ) zGlobList++;
    nTerm++;
  }
  if( nTerm ){
Changes to src/tar.c.
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
  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( 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);
  memcpy(tball.zPrevDir, zName, i);
  tball.zPrevDir[i] = 0;
}








|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
  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( 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);
  memcpy(tball.zPrevDir, zName, i);
  tball.zPrevDir[i] = 0;
}

Changes to src/th_main.c.
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
){
  int rc;
  if( argc!=2 ){
    return Th_WrongNumArgs(interp, "hascap STRING");
  }
  rc = login_has_capability((char*)argv[1],argl[1]);
  if( g.thTrace ){
    Th_Trace("[hascap %.*h] => %d<br />\n", argl[1], argv[1], rc);
  }
  Th_SetResultInt(interp, rc);
  return TH_OK;
}

/*
** TH command:     anycap STRING







|







206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
){
  int rc;
  if( argc!=2 ){
    return Th_WrongNumArgs(interp, "hascap STRING");
  }
  rc = login_has_capability((char*)argv[1],argl[1]);
  if( g.thTrace ){
    Th_Trace("[hascap %#h] => %d<br />\n", argl[1], argv[1], rc);
  }
  Th_SetResultInt(interp, rc);
  return TH_OK;
}

/*
** TH command:     anycap STRING
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
  if( argc!=2 ){
    return Th_WrongNumArgs(interp, "anycap STRING");
  }
  for(i=0; rc==0 && i<argl[1]; i++){
    rc = login_has_capability((char*)&argv[1][i],1);
  }
  if( g.thTrace ){
    Th_Trace("[hascap %.*h] => %d<br />\n", argl[1], argv[1], rc);
  }
  Th_SetResultInt(interp, rc);
  return TH_OK;
}

/*
** TH1 command:  combobox NAME TEXT-LIST NUMLINES







|







233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
  if( argc!=2 ){
    return Th_WrongNumArgs(interp, "anycap STRING");
  }
  for(i=0; rc==0 && i<argl[1]; i++){
    rc = login_has_capability((char*)&argv[1][i],1);
  }
  if( g.thTrace ){
    Th_Trace("[hascap %#h] => %d<br />\n", argl[1], argv[1], rc);
  }
  Th_SetResultInt(interp, rc);
  return TH_OK;
}

/*
** TH1 command:  combobox NAME TEXT-LIST NUMLINES
Changes to src/timeline.c.
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
        const char *z = zTagList;
        Blob links;
        blob_zero(&links);
        while( z && z[0] ){
          for(i=0; z[i] && (z[i]!=',' || z[i+1]!=' '); i++){}
          if( zThisTag==0 || memcmp(z, zThisTag, i)!=0 || zThisTag[i]!=0 ){
            blob_appendf(&links,
                  "<a href=\"%s/timeline?r=%.*t&nd&c=%s\">%.*h</a>%.2s",
                  g.zTop, i, z, zDate, i, z, &z[i]
            );
          }else{
            blob_appendf(&links, "%.*h", i+2, z);
          }
          if( z[i]==0 ) break;
          z += i+2;
        }
        @ tags: %s(blob_str(&links)))
        blob_reset(&links);
      }else{







|



|







298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
        const char *z = zTagList;
        Blob links;
        blob_zero(&links);
        while( z && z[0] ){
          for(i=0; z[i] && (z[i]!=',' || z[i+1]!=' '); i++){}
          if( zThisTag==0 || memcmp(z, zThisTag, i)!=0 || zThisTag[i]!=0 ){
            blob_appendf(&links,
                  "<a href=\"%s/timeline?r=%#t&nd&c=%s\">%#h</a>%.2s",
                  g.zTop, i, z, zDate, i, z, &z[i]
            );
          }else{
            blob_appendf(&links, "%#h", i+2, z);
          }
          if( z[i]==0 ) break;
          z += i+2;
        }
        @ tags: %s(blob_str(&links)))
        blob_reset(&links);
      }else{