pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fn_search_path semantics


From: John Darrington
Subject: fn_search_path semantics
Date: Mon, 13 Nov 2006 08:25:34 +0800
User-agent: Mutt/1.5.9i

If you start pspp in interactive mode, and type:

 include "anything".

it will promptly crash.


The offending line seems to be this one in src/language/line-buffer.c

 char *found_fn = fn_search_path (fn, ds_cstr (&getl_include_path),
                                       fn_dir_name (cur_source->fn));

since cur_source is NULL.


Looking at the definition of fn_search_path in src/data/file-name.c:

/* Searches for a configuration file with name NAME in the path
   given by PATH, which is tilde- and environment-interpolated.
   Directories in PATH are delimited by ':'.  Returns the
   malloc'd full name of the first file found, or NULL if none is
   found.

   If PREFIX is non-NULL, then it is prefixed to each file name;
   i.e., it looks like PREFIX/PATH_COMPONENT/NAME.  This is not
   done with absolute directories in the path. */
 char *
 fn_search_path (const char *base_name, const char *path_, const char
   *prefix)


1. The comment doesn't seem to fit the signature.

2. I can't see a reason for the PREFIX argument anyway.  Why would we
   want to prefix the search path components?  All other calls to
   fn_search_path, pass NULL for this argument.


J'


-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]