Fossil

Check-in [7d048033]
Login

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

Overview
Comment:When parsing glob settings, allow splits on newlines as well as commas. Allows versionable glob settings to be written one glob per line for readability.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | versionable-settings
Files: files | file ages | folders
SHA1:7d048033924f6171390e97b680f20b4972e367f5
User & Date: ben 2011-05-22 09:44:45
Context
2011-05-22
09:50
Turn ignore-glob, crnl-glob, binary-glob and manifest settings into versionable settings. check-in: 43b0d795 user: ben tags: versionable-settings
09:44
When parsing glob settings, allow splits on newlines as well as commas. Allows versionable glob settings to be written one glob per line for readability. check-in: 7d048033 user: ben tags: versionable-settings
09:38
Add db_get_versionable_setting() for implementing 'versionable settings', which is like db_get() except will prefer to read the value from .fossil-settings/NAME in the checked out source, rather than the database. check-in: 09e52f0d user: ben tags: versionable-settings
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/glob.c.

108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
  if( zPatternList==0 || zPatternList[0]==0 ) return 0;
  nList = strlen(zPatternList);
  p = fossil_malloc( sizeof(*p) + nList+1 );
  memset(p, 0, sizeof(*p));
  z = (char*)&p[1];
  memcpy(z, zPatternList, nList+1);
  while( z[0] ){
    while( z[0]==',' || z[0]==' ' ) z++;  /* Skip leading spaces */
    if( z[0]=='\'' || z[0]=='"' ){
      delimiter = z[0];
      z++;
    }else{
      delimiter = ',';
    }
    if( z[0]==0 ) break;
    p->azPattern = fossil_realloc(p->azPattern, (p->nPattern+1)*sizeof(char*) );
    p->azPattern[p->nPattern++] = z;
    for(i=0; z[i] && z[i]!=delimiter; i++){}
    if( delimiter==',' ){
      /* Remove trailing spaces on a comma-delimited pattern */
      for(j=i; j>1 && z[j-1]==' '; j--){}
      if( j<i ) z[j] = 0;
    }
    if( z[i]==0 ) break;
    z[i] = 0;
    z += i+1;
  }
  return p;







|









|

|
|







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
  if( zPatternList==0 || zPatternList[0]==0 ) return 0;
  nList = strlen(zPatternList);
  p = fossil_malloc( sizeof(*p) + nList+1 );
  memset(p, 0, sizeof(*p));
  z = (char*)&p[1];
  memcpy(z, zPatternList, nList+1);
  while( z[0] ){
    while( z[0]==',' || z[0]==' ' || z[0]=='\n' || z[0]=='\r' ) z++;  /* Skip leading spaces and newlines */
    if( z[0]=='\'' || z[0]=='"' ){
      delimiter = z[0];
      z++;
    }else{
      delimiter = ',';
    }
    if( z[0]==0 ) break;
    p->azPattern = fossil_realloc(p->azPattern, (p->nPattern+1)*sizeof(char*) );
    p->azPattern[p->nPattern++] = z;
    for(i=0; z[i] && z[i]!=delimiter && z[i]!='\n' && z[i]!='\r'; i++){}
    if( delimiter==',' ){
      /* Remove trailing spaces / newlines on a comma-delimited pattern */
      for(j=i; j>1 && (z[j-1]==' ' || z[j-1]=='\n' || z[j-1]=='\r'); j--){}
      if( j<i ) z[j] = 0;
    }
    if( z[i]==0 ) break;
    z[i] = 0;
    z += i+1;
  }
  return p;