needs_quotes Function

public pure function needs_quotes(a) result(q)

Determine whether an argument requires quoting for safe shell parsing.

A conservative check: any whitespace or quotes trigger quoting.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: a

Return Value logical


Called by

proc~~needs_quotes~~CalledByGraph proc~needs_quotes needs_quotes proc~join_argv join_argv proc~join_argv->proc~needs_quotes proc~parse_cli parse_cli proc~parse_cli->proc~join_argv proc~parse_cli_config parse_cli_config proc~parse_cli_config->proc~parse_cli

Source Code

   pure logical function needs_quotes(a) result(q)
      character(len=*), intent(in) :: a
      q = (index(a, ' ') /= 0) .or. (index(a, char(9)) /= 0) .or. (index(a, '"') /= 0) .or. (index(a, "'") /= 0)
   end function needs_quotes