Expand LinuxCNC interpreter regression coverage
This commit is contained in:
@@ -32,9 +32,29 @@ if [[ ! -f "$MANIFEST_FILE" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
validate_manifest_path() {
|
||||
local src_rel="$1"
|
||||
if [[ "$src_rel" = /* || "$src_rel" == */ || "$src_rel" == *"//"* ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
local component
|
||||
local -a path_components
|
||||
IFS=/ read -r -a path_components <<< "$src_rel"
|
||||
for component in "${path_components[@]}"; do
|
||||
if [[ -z "$component" || "$component" == "." || "$component" == ".." ]]; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
while IFS= read -r src_rel; do
|
||||
[[ -z "$src_rel" ]] && continue
|
||||
[[ "${src_rel:0:1}" == "#" ]] && continue
|
||||
if ! validate_manifest_path "$src_rel"; then
|
||||
echo "invalid manifest path: $src_rel" >&2
|
||||
exit 1
|
||||
fi
|
||||
copy_file "$src_rel"
|
||||
done < "$MANIFEST_FILE"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user