Please enable JavaScript.
Coggle requires JavaScript to display documents.
Main, Split string(buffer), Free(buffer), save the command in a buffer, A…
Main
Isatty
if(interactive)
True
Show prompt
Check sigint ctrl c
Start Loop
Read command line
save the numbers of characters read
numbers of characters in != 1
True
User not write env
2 more items...
False
User press enter
1 more item...
False
Split string(buffer)
array[0][0] == '/'
True
token = array[0]
False
split PATH in tokes
token = _split_string(array)
get env
Counting of environmental variables
We compare whether PATH exists in the environment variables
Return(path)
if(path[0] == ":")
False
_split_string(path,":")
A path copy is made
split path in tokens with strtok
counts the number of commands typed
1 more item...
It checks if they write spaces at the beginning of commands and concatenates
Verify that the concatenation is valid
True
We changed the ":" for "." so that a separation is not generated at the beginning
_hack_path(path)
A buffer copy is made
split buffer in tokens with strtok
counts the number of commands typed
starts saving typed commands to tokens
verification of tokens.
_tokens(array)
Excev
Free(buffer)
save the command in a buffer
A delimiter is set
strtok again
count
Return array of strings
return(**array)