Changeset 3222df2
- Timestamp:
- Aug 16, 2017, 12:53:41 PM (7 years ago)
- Branches:
- master
- Children:
- b807d8f
- Parents:
- 9625c55
- git-author:
- Jason Gross <jgross@mit.edu> (08/06/17 00:13:19)
- git-committer:
- Jason Gross <jasongross9@gmail.com> (08/16/17 12:53:41)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl/Logging.pm
r54c5395 r3222df2 144 144 Sanitizes C<FILENAME> and concatenates it with C<BASE_PATH>. 145 145 146 In any filename, C<"/"> andany control characters (characters which147 match C<[:cntrl:]> get replaced by underscores. If the resulting148 filename is empty or equal to C<"."> or C<"..">, it is replaced with149 C<" weird">.146 In any filename, C<"/">, any control characters (characters which 147 match C<[:cntrl:]>), and any initial C<"."> characters get replaced by 148 underscores. If the resulting filename is empty, it is replaced with 149 C<"_EMPTY_">. 150 150 151 151 =cut … … 155 155 my $filename = shift; 156 156 $filename =~ s/[[:cntrl:]\/]/_/g; 157 if ($filename eq '' || $filename eq '.' || $filename eq '..') { 158 $filename = 'weird'; 159 } 157 $filename =~ s/^\./_/g; # handle ., .., and hidden files 158 $filename = '_EMPTY_' if $filename eq ''; 160 159 # The original C code also removed characters less than '!' and 161 160 # greater than or equal to '~', marked file names beginning with a
Note: See TracChangeset
for help on using the changeset viewer.