mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Fix path compression to include removing "/./".
- This involved a fix to the FTP scripts that relied on the old behavior.
This commit is contained in:
parent
d11a1dab73
commit
f1d165956a
3 changed files with 12 additions and 6 deletions
|
@ -19,7 +19,7 @@ function extract_path(input: string): string
|
|||
}
|
||||
|
||||
## Compresses a given path by removing '..'s and the parent directory it
|
||||
## references and also removing '/'s.
|
||||
## references and also removing dual '/'s and extraneous '/./'s.
|
||||
## dir: a path string, either relative or absolute
|
||||
## Returns: a compressed version of the input path
|
||||
function compress_path(dir: string): string
|
||||
|
@ -41,7 +41,7 @@ function compress_path(dir: string): string
|
|||
return compress_path(dir);
|
||||
}
|
||||
|
||||
const multislash_sep = /(\/){2,}/;
|
||||
const multislash_sep = /(\/\.?){2,}/;
|
||||
parts = split_all(dir, multislash_sep);
|
||||
for ( i in parts )
|
||||
if ( i % 2 == 0 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue