Date: Wed, 25 Feb 1998 17:52:49 +0200 (IST) From: Eli Zaretskii To: Dim Zegebart cc: DJGPP Mail List Subject: Re: Funny thing with _fixpath In-Reply-To: <34F3CBC1.7066@post.comstar.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 25 Feb 1998, Dim Zegebart wrote: > _fixedpath(ini_name,fixed_name); > > // What do you thinking about contents of fixed_name now ? Yes, I also > think it's just 'my_ini.ini' Wrong! > // But the real contents after _fixedpath is : > 'c:/djgpp/contrib/mywork/my_ini.ini' exactly where from I running my exe > file ! That's exactly what `_fixpath' is supposed to do. It canonicalizes the file name. ``Canonicalizing'' means that it adds the drive and the current directory, if they aren't already there, and resolves "." and ".." if present. It also does other useful things, like converting all slashes to forward variety; see the libc docs. What exactly is the problem? > But, how I should allocate space for fixed_name exept declaring it as > 'char fixed_name[MAXDIR]' ? Either char fixed_path[FILENAME_MAX]; or char fixed_path[PATH_MAX]; The first is ANSI C (defined on stdio.h), the second is POSIX (defined in limits.h).