Portably get one character from standard input using standard library only
Your strcmp can be replaced with:

if (*prompt) {


Your last loop has issues. You effectively have both a precondition (feof) and a postcondition (next). You can replace the lot with:

while (!feof(stdin))
    if (getchar() == '\n')
        break;