Merge remote-tracking branch 'refs/remotes/origin/main'

This commit is contained in:
starnakin 2023-07-03 23:54:52 +02:00
commit b0c936e8ec
3 changed files with 8 additions and 6 deletions

View File

@ -7,7 +7,7 @@ que des variables d'environnement dans un terminal.
## Intallation :
Il suffit de clone le repos, celui-ci possède un fichier déjà compilé
Il suffit de télécharger une release qui possède un fichier précompilé
```bash
./zzsh
```

View File

@ -13,7 +13,7 @@
int len(void** list)
{
int index;
for (index = 0; list[index]!=NULL; index++);
for (index = 0; list[index]!=NULL; index++);
return index;
}
@ -71,7 +71,7 @@ char* get_executable_path(const char* executable, lst** env)
tab_free((void**)path_env_splited);
return path_file;
}
free(path_file);
}
tab_free((void**)path_env_splited);

View File

@ -25,11 +25,13 @@ static char* get_prompt(lst** env)
strcpy(cwd, "~");
strcat(cwd, cwd + strlen(home));
}
out = str_merger(8, "[", user, "@", hostname_buff, "]", " > ", cwd, " ");
out = str_merger(8, user, "[", "@", hostname_buff, "]", " > ", cwd, " ");
char* temp = out;
if (strcmp(user, "root") == 0)
out = str_merger(2, out, "# ");
out = str_merger(2, "# ", out);
else
out = str_merger(2, out, "$ ");
out = str_merger(2, "$ ", out);
free(temp);
return out;
}