fix(exec): remove exec_get_current_path(), use instead getcwd();
switch to the home directory with 'cd' without args
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Changes to be committed:
#	modified:   TODO.txt
#	modified:   exec.c
#	modified:   main.c
#
# Changes not staged for commit:
#	modified:   test/test_exec.txt
#
# Untracked files:
#	keys.txt
#	tags
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git a/TODO.txt b/TODO.txt
index bbf606e..d153ee7 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -11,3 +11,4 @@
 [x] Waiting of fg-procs while bg-procs are running
  \_  changed wait() to waitpid()
 [x] Ability to change current directory
+[x] 'cd' without params to home directory
diff --git a/exec.c b/exec.c
index 34b1c3f..c05ef5a 100644
--- a/exec.c
+++ b/exec.c
@@ -50,6 +50,7 @@ static int fork_exec_argv(char **argv, int *cmd_fd, int flag_wait)
     return res;
 }

+#if 0
 int exec_get_current_path(char *buff, int bufflen)
 {
     int fds[2];
@@ -59,7 +60,6 @@ int exec_get_current_path(char *buff, int bufflen)
         fprintf(stderr, "get_current_path: buff = NULL\n");
         return 0;
     }
-
     pipe(fds);
     pid = fork();
     if(pid == -1) {
@@ -89,6 +89,7 @@ int exec_get_current_path(char *buff, int bufflen)
         buff[res] = '\0';
     return 1;
 }
+#endif

 static char **word_list_part_to_argv(word *head, int len)
 {
@@ -117,15 +118,19 @@ static char **word_list_part_to_argv(word *head, int len)
 static int chdir_handle(char **argv, int cmd_len)
 {
     int res = 0;
+    char *path_res;
     if(cmd_len > 2) {
         fprintf(stderr, "cd: Too many arguments.\n");
         return 1;
     }
-    res = chdir(argv[1]);
-    if(-1 == res)
+    res = (cmd_len == 1) ? chdir(getenv("HOME")) : chdir(argv[1]);
+    if(-1 == res) {
         perror(argv[0]);
-    else
-        exec_get_current_path(cur_path, PATH_LEN_MAX);
+    } else {
+        path_res = getcwd(cur_path, PATH_LEN_MAX);
+        if(!path_res)
+            perror(NULL);
+    }
     return res;
 }

diff --git a/main.c b/main.c
index 23c255d..03ee464 100644
--- a/main.c
+++ b/main.c
@@ -144,9 +144,13 @@ memfree:

 int main(int argc, char* argv[])
 {
+    char *res;
     if(argc > 1 && 0 == strcmp(argv[1], "-s"))
         only_print_tokens = 1; /* do not execute. for debug purposes */
-    exec_get_current_path(cur_path, PATH_LEN_MAX);
+    /* exec_get_current_path(cur_path, PATH_LEN_MAX); */
+    res = getcwd(cur_path, PATH_LEN_MAX);
+    if(!res)
+        perror(NULL);
     loop();
     return 0;
 }
