title: Setting GNU readline prompt to NULL causes custom prompt to be overwritten
body: <p>I am writing a custom shell in c, and have encountered a strange little bug, which can be seen in the following testcase:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdbool.h&gt;
  
  #include &lt;readline/readline.h&gt;
  #include &lt;readline/history.h&gt;
  
  int main(int argc, char **argv, char **env) {
    while(true) {
      fprintf(stdout, "input: ");
      char *line = readline(NULL);
  
      if(line) {
        add_history(line);
      }
    }
    return 0;
  }
  </code></pre>
  
  <p>The program spits out the prompt, and if I type something like this:</p>
  
  <pre><code>input: foo bar baz
  </code></pre>
  
  <p>And then go to erase the line, input: gets erased as well (once I hit the first character I inputted). Is there anyway to fix this? The only thing I could think to do was <code>fflush(stdout)</code> but that didn't work.</p>