Merge: manage errors with command from path
This commit is contained in:
commit
1f0887e7db
2 changed files with 6 additions and 2 deletions
1
dev/TODO
1
dev/TODO
|
@ -2,7 +2,6 @@
|
||||||
- '<<' with history?
|
- '<<' with history?
|
||||||
- finding commands
|
- finding commands
|
||||||
- built-in commands
|
- built-in commands
|
||||||
- relative/absolute paths
|
|
||||||
- signals
|
- signals
|
||||||
- ^C, ^D, ^\
|
- ^C, ^D, ^\
|
||||||
- variables
|
- variables
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
|
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/11/16 12:07:26 by jschaft #+# #+# */
|
/* Created: 2023/11/16 12:07:26 by jschaft #+# #+# */
|
||||||
/* Updated: 2024/05/01 17:53:38 by mcolonna ### ########.fr */
|
/* Updated: 2024/06/07 11:40:04 by jschaft ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
@ -34,6 +34,11 @@ const char *search_path(
|
||||||
const char *r;
|
const char *r;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
if (access(prog, X_OK) >= 0)
|
||||||
|
{
|
||||||
|
mem_free((void *)prog2);
|
||||||
|
return (ft_strdup(prog));
|
||||||
|
}
|
||||||
while (path[i] != NULL)
|
while (path[i] != NULL)
|
||||||
{
|
{
|
||||||
r = str_join(fatal_error, mc, path[i], prog2);
|
r = str_join(fatal_error, mc, path[i], prog2);
|
||||||
|
|
Loading…
Add table
Reference in a new issue