Changeset 1c481ee in mainline for uspace/app/bdsh/exec.c


Ignore:
Timestamp:
2019-03-09T15:40:05Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
587867a
Parents:
c56a3eb
git-author:
Matthieu Riolo <matthieu.riolo@…> (2019-03-02 15:55:07)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-03-09 15:40:05)
Message:

This commit fixes #684 and adds autocompletion for subdirectories in search_path. The original implementation of find_command()
will find cmd inside the working directory even without
the prefix './'. However, those cmds would have not been visible in
the auto completion. This commit prevents this from happening.

The problem can be traced back to vfs_absolutize() which treats paths
without the './' prefix as relative paths. The changes made unsures
that only relative or absolute pathes will be passed to vfs_absolutize()

This commit also fixes the problem, that subdirectories inside the
search_path would not be autocomplete. BDSH would execute such paths.
The reason being is that such paths was interpreted as relative paths.
Now BDSH makes a distinction between relatives paths or paths inside
search_path

File:
1 edited

Legend:

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

    rc56a3eb r1c481ee  
    7272{
    7373        /* The user has specified a full or relative path, just give it back. */
    74         if (-1 != try_access(cmd)) {
    75                 return str_dup(cmd);
     74        if (is_path(cmd)) {
     75                if (-1 != try_access(cmd)) {
     76                        return str_dup(cmd);
     77                }
    7678        }
    7779
Note: See TracChangeset for help on using the changeset viewer.