Fossil

Check-in [71a1c7b22b]
Login

Check-in [71a1c7b22b]

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

Overview
Comment:Fix to the multi-repository name parser for CGI.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 71a1c7b22bc86757d3f1871e3b295d85f59a802f
User & Date: drh 2011-04-18 19:17:22.962
Context
2011-04-18
19:32
Fix another issue with directory search for CGI. ... (check-in: 0fc9b5e1f2 user: drh tags: trunk)
19:17
Fix to the multi-repository name parser for CGI. ... (check-in: 71a1c7b22b user: drh tags: trunk)
18:25
Make sure the "update" command always works the same with or without the -v option. Ticket [40a7d777a465]. ... (check-in: e11513631f user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
    while( 1 ){
      while( zPathInfo[i] && zPathInfo[i]!='/' ){ i++; }
      zRepo = zToFree = mprintf("%s%.*s.fossil",g.zRepositoryName,i,zPathInfo);

      /* To avoid mischief, make sure the repository basename contains no
      ** characters other than alphanumerics, "-", "/", and "_".
      */
      for(j=strlen(g.zRepositoryName)+1, k=0; k<i-1; j++, k++){
        if( !fossil_isalnum(zRepo[j]) && zRepo[j]!='-' && zRepo[j]!='/' ){
          zRepo[j] = '_';
        }
      }
      if( zRepo[0]=='/' && zRepo[1]=='/' ){ zRepo++; j--; }

      szFile = file_size(zRepo);







|







907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
    while( 1 ){
      while( zPathInfo[i] && zPathInfo[i]!='/' ){ i++; }
      zRepo = zToFree = mprintf("%s%.*s.fossil",g.zRepositoryName,i,zPathInfo);

      /* To avoid mischief, make sure the repository basename contains no
      ** characters other than alphanumerics, "-", "/", and "_".
      */
      for(j=strlen(g.zRepositoryName)+1, k=0; zRepo[j] && k<i-1; j++, k++){
        if( !fossil_isalnum(zRepo[j]) && zRepo[j]!='-' && zRepo[j]!='/' ){
          zRepo[j] = '_';
        }
      }
      if( zRepo[0]=='/' && zRepo[1]=='/' ){ zRepo++; j--; }

      szFile = file_size(zRepo);