Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Somehow, part of previous change got lost |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | ticket-d17d6e5b17 |
| Files: | files | file ages | folders |
| SHA1: |
92725735119d221cd9844d879607da6d |
| User & Date: | jan.nijtmans 2012-11-21 09:20:15.736 |
Context
|
2012-11-22
| ||
| 09:32 | merge trunk <p>Functional complete and well-tested check-in: e6a1910fa8 user: jan.nijtmans tags: ticket-d17d6e5b17 | |
|
2012-11-21
| ||
| 20:53 | Just commit some weird filenames, even one with a newline in it, to test the code. Closed-Leaf check-in: ac1af2306b user: jan.nijtmans tags: test-ticket-d17d6e5b17 | |
| 09:20 | Somehow, part of previous change got lost check-in: 9272573511 user: jan.nijtmans tags: ticket-d17d6e5b17 | |
| 09:12 | Split off in separate functions <p>Still experimental, but starts looking better check-in: b59dc07818 user: jan.nijtmans tags: ticket-d17d6e5b17 | |
Changes
Changes to src/file.c.
| ︙ | ︙ | |||
479 480 481 482 483 484 485 | /* ** Return true if the filename given is a valid filename for ** a file in a repository. Valid filenames follow all of the ** following rules: ** ** * Does not begin with "/" ** * Does not contain any path element named "." or ".." | | | | 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 |
/*
** Return true if the filename given is a valid filename for
** a file in a repository. Valid filenames follow all of the
** following rules:
**
** * Does not begin with "/"
** * Does not contain any path element named "." or ".."
** * Does not contain any of these characters in the path: "\"
** * Does not end with "/".
** * Does not contain two or more "/" characters in a row.
** * Contains at least one character
*/
int file_is_simple_pathname(const char *z){
int i;
char c = z[0];
if( c=='/' || c==0 ) return 0;
if( c=='.' ){
if( z[1]=='/' || z[1]==0 ) return 0;
if( z[1]=='.' && (z[2]=='/' || z[2]==0) ) return 0;
}
for(i=0; (c=z[i])!=0; i++){
if( c=='\\' ){
return 0;
}
if( c=='/' ){
if( z[i+1]=='/' ) return 0;
if( z[i+1]=='.' ){
if( z[i+2]=='/' || z[i+2]==0 ) return 0;
if( z[i+2]=='.' && (z[i+3]=='/' || z[i+3]==0) ) return 0;
|
| ︙ | ︙ |