added code comments
authorMart Lubbers <mart@martlubbers.net>
Mon, 25 Jan 2016 10:21:44 +0000 (11:21 +0100)
committerMart Lubbers <mart@martlubbers.net>
Mon, 25 Jan 2016 10:21:44 +0000 (11:21 +0100)
Clean System Files/readLine.c

index 2855915..b645039 100644 (file)
@@ -75,14 +75,12 @@ void cleanReadLine(CleanString prompt, int history, CleanString *result)
                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;
-       } 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));