1
0
mirror of https://gitlab.com/klmp200/fish.git synced 2024-11-21 16:23:20 +00:00

"cd" now works without arguments, added README

This commit is contained in:
Aethor 2017-06-07 18:56:22 +02:00
parent 1b99d6cfe5
commit c22c3949c2

View File

@ -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");