Lines Matching refs:new_path
172 char *new_path = (char *)malloc(dest_len + 2); in shell_cmd_cd() local
173 memset(new_path, 0, dest_len + 2); in shell_cmd_cd()
174 strncpy(new_path, argv[1], dest_len); in shell_cmd_cd()
179 shell_current_path = new_path; in shell_cmd_cd()
206 char *new_path = (char *)malloc(new_len + 2); in shell_cmd_cd() local
207 memset(new_path, 0, sizeof(new_path)); in shell_cmd_cd()
208 strncpy(new_path, shell_current_path, current_dir_len); in shell_cmd_cd()
211 new_path[current_dir_len] = '/'; in shell_cmd_cd()
212 strcat(new_path, argv[1] + dest_offset); in shell_cmd_cd()
213 int x = chdir(new_path); in shell_cmd_cd()
218 new_path[new_len + 1] = '\0'; in shell_cmd_cd()
219 shell_current_path = new_path; in shell_cmd_cd()
224 free(new_path); in shell_cmd_cd()
225 printf("ERROR: Cannot switch to directory: %s\n", new_path); in shell_cmd_cd()