Update of bug #16887 (project freeciv):

                  Status:          Ready For Test => In Progress            

    _______________________________________________________

Follow-up Comment #8:

> Maybe, I haven't be clear enough. As current_dir() is a part
> of the public interface, it must work in any environment. If
> it is used in Windows, it will probably produce an error.
> #ifdef must be added inside this function. 

I did add some ifdef's to the function but they are not included in the
patch. Before I do it again, I would like to discuss that is needed. At the
moment the function current_dir() will only work for *nix systems. Thus, it
should return NULL for all other operating systems. Is this OK:


const char *current_dir(void)
{
  static bool init = FALSE;
  static char *current_dir = NULL;

#if !defined(AMIGA) && !defined(WIN32_NATIVE)
  if (!init) {
    ...
  }
#endif /* !defined(AMIGA) && !defined(WIN32_NATIVE) */

  return current_dir;
}


> get_current_dir() doesn't make sense. The current directory is
> a single directory, so there is no reason to return a string
> vector.

This function is used for fileinfolist_infix() which needs an string vector
as argument. It could be renamed to get_mapimg_dirs() which
* uses the current directory on *nix 
* uses the directories returned by get_save_dirs() on other systems

The mapimg file saving from the client is special as it is handled by the
client and not by the server as are save games.

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?16887>

_______________________________________________
  Nachricht geschickt von/durch Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to