Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 65333 invoked by uid 500); 18 Jul 2002 20:30:46 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 65322 invoked from network); 18 Jul 2002 20:30:46 -0000 Errors-To: Message-Id: <5.1.0.14.2.20020718152415.0310dec8@pop3.rowe-clan.net> X-Sender: wrowe%rowe-clan.net@pop3.rowe-clan.net X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 18 Jul 2002 15:28:28 -0500 To: Ben Collins-Sussman From: "William A. Rowe, Jr." Subject: Re: [PATCH] docstrings on apr_filepath_merge() flags? Cc: dev@apr.apache.org, dev@subversion.tigris.org In-Reply-To: <86n0sox1gn.fsf@kepler.ch.collab.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N At 02:47 PM 7/18/2002, Ben Collins-Sussman wrote: >I've got a path as a command-line argument, and I'm trying to convert >it to canonical case using apr_filepath_merge: > > apr_err = apr_filepath_merge (&truenamed_target, NULL, raw_target, > APR_FILEPATH_TRUENAME, pool); > >Unfortunately, this had the side-effect of converting a relative path >into an absolute path. Per the apr_filepath_merge docs [and if it's not there, it needs to be], passing a rootpath of NULL == the cwd. Passing a rootpath of "" (empty) means merge raw_target to an empty path. Please try passing "" to the root path (meaning, merge the path to no characters) and see if that solves your problem. Perhaps the solution is to disambiguate NULL from Empty("") and use a flag instead to designate the "Use CWD" behavior instead of using a NULL arg. >After some experimentation, I discovered that adding the >APR_FILEPATH_NOTABSOLUTE flag prevented this behavior. > >What annoys me is that I *deliberately* ignored this flag, because of >its cryptic docstring: > > /** Fail apr_filepath_merge if the merged path is absolute */ > #define APR_FILEPATH_NOTABSOLUTE 0x08 I wouldn't have expected that, either. Ick. I'll be happy to delve into the code so we can grok this. >I read this docstring, and thought it was talking about somehow >restricting the *inputs* to the function... like forcing the function >to only accept absolute paths, or something. It doesn't make a lot of >sense. No it doesn't. >Does anyone mind if I apply this patch? Please don't. The flags should do exactly what they said. If we aren't returning a full path, every time that the rootpath argument is either NULL (cwd) or a specific full path, then the function is wrong, not the docs. I need to review the original intents before I toss out any more feedback. Bill