title: Trying to open a relative path in Ubuntu doesn't work
body: <p>I'm trying the open a relative path in Ubuntu , but after opening the first folder - called <code>14</code> - the code fails to open the folder inside - called <code>15</code>: </p>
  
  <pre><code>int pathsCtr; // number of folders in RelativeArray
  
  char ** RelativeArray; // the folders in the relative path, currently: 
  
  RelativeArray[0] = "14";
  
  RelativeArray[1] = "15";
  // some code before 
  
  if (pathsCtr &gt; 0 &amp;&amp; flag == TRUE) // then we have a relative path
  {
      int j = 0;
      while (j &lt; pathsCtr)  // run until the last path and open every one
      {
          printf("\n%s\n" , RelativeArray[j]);
          dirp = opendir(RelativeArray[j]);  // open all directories until the last one
          if (dirp == NULL)
                  return -1;
          j++; // proceed to the next directory
      }
  
      flag = FALSE; // turn off the flag , we'll never go near this again
  }
  </code></pre>
  
  <p>When <code>j == 0</code> this line : <code>dirp = opendir(RelativeArray[j]);</code> works and <code>dirp</code> is not <code>NULL</code>.</p>
  
  <p>But when <code>j == 1</code> that line <code>dirp = opendir(RelativeArray[j]);</code> fails and <code>dirp</code> is <code>NULL</code> .</p>
  
  <p>What am I doing wrong? </p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>Assume that I'm doing malloc for <code>RelativeArray</code> before the above code . </p>