[AD] Small change in file.c

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


why doesn't this code in file.c (line: 342) use a for loop?
 
   int pos, end, c;
 
   pos = end = ustrlen(filename);
 
   while (pos>0) {
      c = ugetat(filename, pos-1);
      if ((c == '.') || (c == '/') || (c == OTHER_PATH_SEPARATOR) || (c == DEVICE_SEPARATOR) || (c == '#'))
  break;
      pos--;
   }
like this:
 
   int pos, end, c;
 
  for(pos = end = ustrlen(filename); pos>0; pos--;) {
      c = ugetat(filename, pos-1);
      if ((c == '.') || (c == '/') || (c == OTHER_PATH_SEPARATOR) || (c == DEVICE_SEPARATOR) || (c == '#'))
  break;
   }
Is there a good reason a while loop is used?
 
--
Michael G.
http://www.quicksw.com/mbgsw/


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/