title: Ignore space or newline when reading a line
body: <p>I'm reading a line till enter/return is pressed(like a terminal), but I have some problems when it comes to ignoring just space(s) and just enter(s).</p>
  
  <p>This is how I read and check for space/new line/comment:</p>
  
  <pre><code>char line[256];
  while(printf("%s&gt;", shell_name) &amp;&amp; scanf(" %50[^\n]", line) != EOF){
          if(isspace(*line) == 0 &amp;&amp; line[0] != '#' &amp;&amp; line[0] != '\n'){
  </code></pre>
  
  <p>Input example:</p>
  
  <pre><code>mysh&gt;echo lol
  lol
  mysh&gt; *spaces*
  mysh&gt;
  mysh&gt; *next line(enter)*
  mysh&gt;
  </code></pre>