From a6ca42ec6122465baef9d2f2ce4051b8d5aaf4a4 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 28 Apr 2004 15:49:18 +0000 Subject: suggest replacing system(qq(foo "$xxx")) with system('foo', $xxx) --- perl_checker.src/parser_helper.ml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'perl_checker.src/parser_helper.ml') diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index 1ebaa13..ca28aa8 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -864,6 +864,14 @@ let call_raw force_non_builtin_func (e, para) = | [ List [ Deref(I_array, _) ] ] -> () | _ -> warn_rule (f ^ " is expecting an array and nothing else")) + | "system" -> + (match un_parenthesize_full_l para with + | [ String(l, _) ] -> + if List.exists (fun (s, _) -> String.contains s '\'' || String.contains s '"') l && + not (List.exists (fun (s, _) -> List.exists (String.contains s) [ '<' ; '>' ; '&' ; ';']) l) then + warn_rule "instead of quoting parameters you should give a list of arguments" + | _ -> ()) + | _ -> () ); -- cgit v1.2.1