mirror of
https://gitlab.com/klmp200/fish.git
synced 2024-11-13 04:13:19 +00:00
"cd" now works without arguments, added README
This commit is contained in:
parent
1b99d6cfe5
commit
c22c3949c2
@ -6,6 +6,7 @@
|
||||
#include <stdlib.h>
|
||||
#include "fish_core.h"
|
||||
#include "fish_types.h"
|
||||
#include "fish_settings.h"
|
||||
|
||||
/* Necessary global variables */
|
||||
char * builtinCommandsStr[] = {
|
||||
@ -32,8 +33,16 @@ builtinCommand **getBuiltinCommands(){
|
||||
|
||||
int fishCd(WordArray *args) {
|
||||
if (args->size < 2){
|
||||
fprintf(stderr, "fish: Où sont les arguments de ta commande \"cd\" connard ?!\n");
|
||||
return EXIT_FAILURE;
|
||||
//fprintf(stderr, "fish: Où sont les arguments de ta commande \"cd\" connard ?!\n");
|
||||
Settings* settings = getSettings();
|
||||
|
||||
if(chdir(settings->passwd->pw_dir) != 0){
|
||||
perror("fish");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
freeSettings(settings);
|
||||
//return EXIT_SUCCESS;
|
||||
|
||||
} else {
|
||||
if (chdir(args->words[1]) != 0){
|
||||
perror("fish");
|
||||
|
Loading…
Reference in New Issue
Block a user