Changes in uspace/app/bdsh/compl.c [33b8d024:23a0368] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/compl.c
r33b8d024 r23a0368 34 34 #include <stdlib.h> 35 35 #include <vfs/vfs.h> 36 #include <str.h>37 36 38 37 #include "cmds/cmds.h" … … 41 40 #include "tok.h" 42 41 43 static errno_t compl_init(wchar_t *text, size_t pos, size_t *cstart, void **state);44 static errno_t compl_get_next(void *state, char **compl);42 static int compl_init(wchar_t *text, size_t pos, size_t *cstart, void **state); 43 static int compl_get_next(void *state, char **compl); 45 44 static void compl_fini(void *state); 46 45 … … 69 68 70 69 /** Pointer inside list of directories */ 71 const char * const*path;70 const char **path; 72 71 /** If not @c NULL, should be freed in the end. */ 73 c har **path_list;72 const char **path_list; 74 73 /** Current open directory */ 75 74 DIR *dir; … … 88 87 * Set up iterators in completion object, based on current token. 89 88 */ 90 static errno_t compl_init(wchar_t *text, size_t pos, size_t *cstart, void **state)89 static int compl_init(wchar_t *text, size_t pos, size_t *cstart, void **state) 91 90 { 92 91 compl_t *cs = NULL; … … 94 93 char *prefix = NULL; 95 94 char *dirname = NULL; 96 errno_t retval;95 int retval; 97 96 98 97 token_t *tokens = calloc(WORD_MAX, sizeof(token_t)); … … 219 218 cs->path_list[0] = dirname; 220 219 cs->path_list[1] = NULL; 221 /* The second const ensures that we can't assign a const 222 * string to the non-const array. */ 223 cs->path = (const char *const *) cs->path_list; 220 cs->path = cs->path_list; 224 221 225 222 } else if (cs->is_command) { … … 291 288 292 289 /** Get next match. */ 293 static errno_t compl_get_next(void *state, char **compl)290 static int compl_get_next(void *state, char **compl) 294 291 { 295 292 compl_t *cs = (compl_t *) state; … … 362 359 char *ent_path; 363 360 asprintf(&ent_path, "%s/%s", *cs->path, dent->d_name); 364 vfs_stat_t ent_stat;361 struct stat ent_stat; 365 362 if (vfs_stat_path(ent_path, &ent_stat) != EOK) { 366 363 /* Error */
Note:
See TracChangeset
for help on using the changeset viewer.