OpenCoverage

return.def

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/builtins/return.def
Source codeSwitch to Preprocessed file
LineSourceCount
1This file is return.def, from which is created return.c.-
2It implements the builtin "return" in Bash.-
3-
4Copyright (C) 1987-2015 Free Software Foundation, Inc.-
5-
6This file is part of GNU Bash, the Bourne Again SHell.-
7-
8Bash is free software: you can redistribute it and/or modify-
9it under the terms of the GNU General Public License as published by-
10the Free Software Foundation, either version 3 of the License, or-
11(at your option) any later version.-
12-
13Bash is distributed in the hope that it will be useful,-
14but WITHOUT ANY WARRANTY; without even the implied warranty of-
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-
16GNU General Public License for more details.-
17-
18You should have received a copy of the GNU General Public License-
19along with Bash. If not, see <http://www.gnu.org/licenses/>.-
20-
21$PRODUCES return.c-
22-
23$BUILTIN return-
24-
25$FUNCTION return_builtin-
26$SHORT_DOC return [n]-
27Return from a shell function.-
28-
29Causes a function or sourced script to exit with the return value-
30specified by N. If N is omitted, the return status is that of the-
31last command executed within the function or script.-
32-
33Exit Status:-
34Returns N, or failure if the shell is not executing a function or script.-
35$END-
36-
37#include <config.h>-
38-
39#if defined (HAVE_UNISTD_H)-
40# ifdef _MINIX-
41# include <sys/types.h>-
42# endif-
43# include <unistd.h>-
44#endif-
45-
46#include "../bashintl.h"-
47-
48#include "../shell.h"-
49#include "../execute_cmd.h"-
50#include "common.h"-
51#include "bashgetopt.h"-
52-
53/* If we are executing a user-defined function then exit with the value-
54 specified as an argument. if no argument is given, then the last-
55 exit status is used. */-
56int-
57return_builtin (list)-
58 WORD_LIST *list;-
59{-
60 CHECK_HELPOPT (list);
never executed: __result = (((const unsigned char *) (const char *) ( ((list)->word->word) ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "--help" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: return (258);
(list)Description
TRUEevaluated 101 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1987 times by 1 test
Evaluated by:
  • Self test
(list)->wordDescription
TRUEevaluated 101 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
(((list)->word... ("--help")[0]Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 99 times by 1 test
Evaluated by:
  • Self test
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0-1987
61-
62 return_catch_value = get_exitstat (list);-
63-
64 if (return_catch_flag)
return_catch_flagDescription
TRUEevaluated 2087 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test
1-2087
65 sh_longjmp (return_catch, 1);
executed 2087 times by 1 test: siglongjmp((return_catch), (1));
Executed by:
  • Self test
2087
66 else-
67 {-
68 builtin_error (_("can only `return' from a function or sourced script"));-
69 return (EXECUTION_FAILURE);
executed 1 time by 1 test: return (1);
Executed by:
  • Self test
1
70 }-
71}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.1.2