repositories
/
CleanReadLine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7bd8eb6
)
added code comments
author
Mart Lubbers
<mart@martlubbers.net>
Mon, 25 Jan 2016 10:21:44 +0000
(11:21 +0100)
committer
Mart Lubbers
<mart@martlubbers.net>
Mon, 25 Jan 2016 10:21:44 +0000
(11:21 +0100)
Clean System Files/readLine.c
patch
|
blob
|
history
diff --git
a/Clean System Files/readLine.c
b/Clean System Files/readLine.c
index
2855915
..
b645039
100644
(file)
--- a/
Clean System Files/readLine.c
+++ b/
Clean System Files/readLine.c
@@
-75,14
+75,12
@@
void cleanReadLine(CleanString prompt, int history, CleanString *result)
add_history(cs_answer);
}
add_history(cs_answer);
}
- if(!cs_answer){
- //Transfor answer into cstring
+ if(!cs_answer){ //In case of an EOF
CleanStringVariable(answer, 1);
*result = (CleanString) answer;
memcpy(CleanStringCharacters(answer), "", 1);
CleanStringLength(answer) = 1;
CleanStringVariable(answer, 1);
*result = (CleanString) answer;
memcpy(CleanStringCharacters(answer), "", 1);
CleanStringLength(answer) = 1;
- } else {
- //Transfor answer into cstring
+ } else { //In case of a proper response
CleanStringVariable(answer, strlen(cs_answer));
*result = (CleanString) answer;
memcpy(CleanStringCharacters(answer), cs_answer, strlen(cs_answer));
CleanStringVariable(answer, strlen(cs_answer));
*result = (CleanString) answer;
memcpy(CleanStringCharacters(answer), cs_answer, strlen(cs_answer));