Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/compl.c

    r33b8d024 r23a0368  
    3434#include <stdlib.h>
    3535#include <vfs/vfs.h>
    36 #include <str.h>
    3736
    3837#include "cmds/cmds.h"
     
    4140#include "tok.h"
    4241
    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);
     42static int compl_init(wchar_t *text, size_t pos, size_t *cstart, void **state);
     43static int compl_get_next(void *state, char **compl);
    4544static void compl_fini(void *state);
    4645
     
    6968
    7069        /** Pointer inside list of directories */
    71         const char *const *path;
     70        const char **path;
    7271        /** If not @c NULL, should be freed in the end. */
    73         char **path_list;
     72        const char **path_list;
    7473        /** Current open directory */
    7574        DIR *dir;
     
    8887 * Set up iterators in completion object, based on current token.
    8988 */
    90 static errno_t compl_init(wchar_t *text, size_t pos, size_t *cstart, void **state)
     89static int compl_init(wchar_t *text, size_t pos, size_t *cstart, void **state)
    9190{
    9291        compl_t *cs = NULL;
     
    9493        char *prefix = NULL;
    9594        char *dirname = NULL;
    96         errno_t retval;
     95        int retval;
    9796       
    9897        token_t *tokens = calloc(WORD_MAX, sizeof(token_t));
     
    219218                cs->path_list[0] = dirname;
    220219                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;
    224221
    225222        } else if (cs->is_command) {
     
    291288
    292289/** Get next match. */
    293 static errno_t compl_get_next(void *state, char **compl)
     290static int compl_get_next(void *state, char **compl)
    294291{
    295292        compl_t *cs = (compl_t *) state;
     
    362359                                char *ent_path;
    363360                                asprintf(&ent_path, "%s/%s", *cs->path, dent->d_name);
    364                                 vfs_stat_t ent_stat;
     361                                struct stat ent_stat;
    365362                                if (vfs_stat_path(ent_path, &ent_stat) != EOK) {
    366363                                        /* Error */
Note: See TracChangeset for help on using the changeset viewer.