danielchen@fsl thank you very much for helping.
The problem is that shell_ptr->COMMAND_FP is equal to stdin, it was set before on line 76 which contains:
shell_ptr->COMMAND_FP = stdin;
I really don't understand the logic in the Shell function. This is what I'm watching the execution do; It sets shell_ptr->COMMAND_FP to stdin at line 76 in the beginning. Then it goes into the while on line 91 but since shell_ptr->EXIT is false and we have just entered the function and there is nothing on the command line, the if sentence if ((!shell_ptr->EXIT) && (shell_ptr->CMD_LINE[0] != '\0')) at line 93 evaluates to false and lines 95 to 125 are never executed.
The execution goes then to line 128 where if finds if (!shell_ptr->EXIT). And because shell_ptr->EXIT is false it goes into that "if" to execute the do-while loop. Line 133 contains an if (!fgets(shell_ptr->CMD_LINE, sizeof(shell_ptr->CMD_LINE ), shell_ptr->COMMAND_FP)) that is going to evaluate to true because there is nothing on the command line thus taking the execution to line 134 to the if (shell_ptr->COMMAND_FP != stdin) and because shell_ptr->COMMAND_FP was set to stdin at line 76 in the beginning, then it's going to go to the else setting shell_ptr->EXIT to true and therefore terminating the shell and restarting.
So it doesn't make sense. I don't see how the code would execute differently. It seems that it is expecting to have something in shell_ptr->CMD_LINE which it won't because execution has just started.
How does your execution looks like if you are not seeing constant shell restarts?