title: man: MANPATH environment variable list too long (manpath list too long)
body: <p>When having excessively long <code>MANPATH</code> env-vars I end up in a problem with this error:</p>
  
  <pre><code>$&gt; man &lt;any command&gt;
  man: manpath list too long
  </code></pre>
  
  <p>To figure out when the manpath list is too long I created this small script:</p>
  
  <pre><code>#!/bin/bash
  export MANPATH=
  for i in $(seq 50 10000)
  do
      export MANPATH=/usr:$MANPATH
      man -k gcc &gt; /dev/null
      [ $? -ne 0 ] &amp;&amp; echo "$i ${#MANPATH}" &amp;&amp; exit 0
  done
  </code></pre>
  
  <p>and it seems like it breaks at <code>${#MANPATH}</code> close to 500.</p>
  
  <p>Also <code>man -d</code> does not give me any information I can use... :(</p>
  
  <p>I have never heard (nor found) a limitation to the number of entries in env-vars (besides the maximum length of the environment variables, from which I am far from).</p>
  
  <p>Are there any fixes for this? Preferably a non-root fix ;)</p>
  
  <p>I am running Debian 9.6.</p>
  
  <p>EDIT: This was reported upstream and fixed!</p>