Changeset 1098

Show
Ignore:
Timestamp:
10/11/08 18:27:36 (1 month ago)
Author:
mwhitworth
Message:

Integrate patch to search the current directory commands, change author, add cp as an alias for BtInCopy.

Location:
Whitix/branches/keobject/user/burn
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/keobject/user/burn/builtins.c

    r922 r1098  
    567567        {"cd",BtInChDir}, 
    568568        {"chdir",BtInChDir}, 
     569        {"cp", BtInCopy}, 
    569570        {"copy",BtInCopy}, 
    570571        {"echo",BtInEcho}, 
  • Whitix/branches/keobject/user/burn/help.c

    r909 r1098  
    2626        {"authors", "The burn authors",  
    2727                BOLD_TEXT("AUTHORS") "\nMatthew Whitworth\n\n" 
    28                 BOLD_TEXT("CONTRIBUTORS") "\nKostadin Dominov"}, 
     28                BOLD_TEXT("CONTRIBUTORS") "\nKostadin Damyanov"}, 
    2929        {"burn", "About burn", 
    3030                BOLD_TEXT("ABOUT BURN")"\n\nBurn is an interactive shell for the Whitix operating system. It features " 
  • Whitix/branches/keobject/user/burn/main.c

    r921 r1098  
    111111 
    112112struct FileDirectory* dir=NULL; 
     113struct FileDirectory* cwdir=NULL; 
    113114 
    114115char* CommandCompleter(struct ConsReadContext* context, char* string, int state) 
    115116{ 
    116117        struct FileDirEnt* ent; 
     118        struct FileDirEnt* cwdent; 
    117119        struct Stat stat; 
    118120         
     
    120122        { 
    121123                dir=FileDirOpen("/Applications"); 
     124                cwdir=FileDirOpen(currPath); 
    122125                 
    123126                if (!dir) 
     
    141144        } 
    142145         
    143         if (!ent) 
     146        while ( ( cwdent = FileDirNext(cwdir) ) ) 
     147        { 
     148                if (cwdent->name[0] == '.') 
     149                        continue; 
     150                         
     151                if (SysStat(cwdent->name, &stat, cwdir->fd)) 
     152                        continue; 
     153                         
     154                /* Only files can be executed. */ 
     155                if (!(stat.mode & _SYS_STAT_FILE)) 
     156                        continue; 
     157                         
     158                if (!strncasecmp(string, cwdent->name, strlen(string))) 
     159                        break; 
     160        } 
     161         
     162        if (!ent && !cwdent) 
    144163        { 
    145164                FileDirClose(dir); 
     165                FileDirClose(cwdir); 
    146166                return NULL; 
    147167        } 
    148168         
     169        if(!ent && cwdent) 
     170        { 
     171                return strdup(cwdent->name); 
     172        } 
     173         
    149174        return strdup(ent->name); 
    150175} 
     
    153178{ 
    154179        struct FileDirEnt* ent; 
     180        struct FileDirEnt* cwdent; 
    155181        char* name, *entName; 
    156182        static char* dirName;