From eb6d08af973484e37e3efb0f159cf732cc618e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 2 Feb 2011 11:09:50 +0100 Subject: Never allow os:find_executable/1 to return the path of directories --- lib/kernel/test/os_SUITE.erl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lib/kernel/test/os_SUITE.erl') diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl index eacf3c7584..3f6a7f4392 100644 --- a/lib/kernel/test/os_SUITE.erl +++ b/lib/kernel/test/os_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -156,6 +156,21 @@ find_executable(Config) when is_list(Config) -> ?line find_exe(Current, "my_batch", ".bat", Path), ok; {unix, _} -> + DataDir = ?config(data_dir, Config), + + %% Smoke test. + case lib:progname() of + erl -> + ?line ErlPath = os:find_executable("erl"), + ?line true = is_list(ErlPath), + ?line true = filelib:is_regular(ErlPath); + _ -> + %% Don't bother -- the progname could include options. + ok + end, + + %% Never return a directory name. + ?line false = os:find_executable("unix", [DataDir]), ok; vxworks -> ok -- cgit v1.2.3