Changeset 1098
- Timestamp:
- 10/11/08 18:27:36 (1 month ago)
- Location:
- Whitix/branches/keobject/user/burn
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/keobject/user/burn/builtins.c
r922 r1098 567 567 {"cd",BtInChDir}, 568 568 {"chdir",BtInChDir}, 569 {"cp", BtInCopy}, 569 570 {"copy",BtInCopy}, 570 571 {"echo",BtInEcho}, -
Whitix/branches/keobject/user/burn/help.c
r909 r1098 26 26 {"authors", "The burn authors", 27 27 BOLD_TEXT("AUTHORS") "\nMatthew Whitworth\n\n" 28 BOLD_TEXT("CONTRIBUTORS") "\nKostadin D ominov"},28 BOLD_TEXT("CONTRIBUTORS") "\nKostadin Damyanov"}, 29 29 {"burn", "About burn", 30 30 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 111 111 112 112 struct FileDirectory* dir=NULL; 113 struct FileDirectory* cwdir=NULL; 113 114 114 115 char* CommandCompleter(struct ConsReadContext* context, char* string, int state) 115 116 { 116 117 struct FileDirEnt* ent; 118 struct FileDirEnt* cwdent; 117 119 struct Stat stat; 118 120 … … 120 122 { 121 123 dir=FileDirOpen("/Applications"); 124 cwdir=FileDirOpen(currPath); 122 125 123 126 if (!dir) … … 141 144 } 142 145 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) 144 163 { 145 164 FileDirClose(dir); 165 FileDirClose(cwdir); 146 166 return NULL; 147 167 } 148 168 169 if(!ent && cwdent) 170 { 171 return strdup(cwdent->name); 172 } 173 149 174 return strdup(ent->name); 150 175 } … … 153 178 { 154 179 struct FileDirEnt* ent; 180 struct FileDirEnt* cwdent; 155 181 char* name, *entName; 156 182 static char* dirName;
