dslinux/user/perl/ext/Cwd Changes Cwd.xs Makefile.PL ppport.h

cayenne dslinux_cayenne at user.in-berlin.de
Mon Dec 4 17:59:10 CET 2006


Update of /cvsroot/dslinux/dslinux/user/perl/ext/Cwd
In directory antilope:/tmp/cvs-serv17422/ext/Cwd

Added Files:
	Changes Cwd.xs Makefile.PL ppport.h 
Log Message:
Adding fresh perl source to HEAD to branch from

--- NEW FILE: Cwd.xs ---
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#define NEED_sv_2pv_nolen
#include "ppport.h"

#ifdef I_UNISTD
#   include <unistd.h>
#endif

/* The realpath() implementation from OpenBSD 2.9 (realpath.c 1.4)
 * Renamed here to bsd_realpath() to avoid library conflicts.
 * --jhi 2000-06-20 
 */

/* See
 * http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2004-11/msg00979.html
 * for the details of why the BSD license is compatible with the
 * AL/GPL standard perl license.
 */

/*
 * Copyright (c) 1994
 *	The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Jan-Simon Pendry.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: realpath.c,v 1.4 1998/05/18 09:55:19 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */

/* OpenBSD system #includes removed since the Perl ones should do. --jhi */

#ifndef MAXSYMLINKS
#define MAXSYMLINKS 8
#endif

/*
 * char *realpath(const char *path, char resolved_path[MAXPATHLEN]);
 *
 * Find the real name of path, by removing all ".", ".." and symlink
 * components.  Returns (resolved) on success, or (NULL) on failure,
 * in which case the path which caused trouble is left in (resolved).
 */
static
char *
bsd_realpath(const char *path, char *resolved)
{
#ifdef VMS
       dTHX;
       return Perl_rmsexpand(aTHX_ (char*)path, resolved, NULL, 0);
#else
	int rootd, serrno;
	char *p, *q, wbuf[MAXPATHLEN];
	int symlinks = 0;

	/* Save the starting point. */
#ifdef HAS_FCHDIR
	int fd;

	if ((fd = open(".", O_RDONLY)) < 0) {
		(void)strcpy(resolved, ".");
		return (NULL);
	}
#else
	char wd[MAXPATHLEN];

	if (getcwd(wd, MAXPATHLEN - 1) == NULL) {
		(void)strcpy(resolved, ".");
		return (NULL);
	}
#endif

	/*
	 * Find the dirname and basename from the path to be resolved.
	 * Change directory to the dirname component.
	 * lstat the basename part.
	 *     if it is a symlink, read in the value and loop.
	 *     if it is a directory, then change to that directory.
	 * get the current directory name and append the basename.
	 */
	(void)strncpy(resolved, path, MAXPATHLEN - 1);
	resolved[MAXPATHLEN - 1] = '\0';
loop:
	q = strrchr(resolved, '/');
	if (q != NULL) {
		p = q + 1;
		if (q == resolved)
			q = "/";
		else {
			do {
				--q;
			} while (q > resolved && *q == '/');
			q[1] = '\0';
			q = resolved;
		}
		if (chdir(q) < 0)
			goto err1;
	} else
		p = resolved;

#if defined(HAS_LSTAT) && defined(HAS_READLINK) && defined(HAS_SYMLINK)
    {
	struct stat sb;
	/* Deal with the last component. */
	if (lstat(p, &sb) == 0) {
		if (S_ISLNK(sb.st_mode)) {
			int n;
			if (++symlinks > MAXSYMLINKS) {
				errno = ELOOP;
				goto err1;
			}
			n = readlink(p, resolved, MAXPATHLEN-1);
			if (n < 0)
				goto err1;
			resolved[n] = '\0';
			goto loop;
		}
		if (S_ISDIR(sb.st_mode)) {
			if (chdir(p) < 0)
				goto err1;
			p = "";
		}
	}
    }
#endif

	/*
	 * Save the last component name and get the full pathname of
	 * the current directory.
	 */
	(void)strcpy(wbuf, p);
	if (getcwd(resolved, MAXPATHLEN) == 0)
		goto err1;

	/*
	 * Join the two strings together, ensuring that the right thing
	 * happens if the last component is empty, or the dirname is root.
	 */
	if (resolved[0] == '/' && resolved[1] == '\0')
		rootd = 1;
	else
		rootd = 0;

	if (*wbuf) {
		if (strlen(resolved) + strlen(wbuf) + (1 - rootd) + 1 > MAXPATHLEN) {
			errno = ENAMETOOLONG;
			goto err1;
		}
		if (rootd == 0)
			(void)strcat(resolved, "/");
		(void)strcat(resolved, wbuf);
	}

	/* Go back to where we came from. */
#ifdef HAS_FCHDIR
	if (fchdir(fd) < 0) {
		serrno = errno;
		goto err2;
	}
#else
	if (chdir(wd) < 0) {
		serrno = errno;
		goto err2;
	}
#endif

	/* It's okay if the close fails, what's an fd more or less? */
#ifdef HAS_FCHDIR
	(void)close(fd);
#endif
	return (resolved);

err1:	serrno = errno;
#ifdef HAS_FCHDIR
	(void)fchdir(fd);
#else
	(void)chdir(wd);
#endif

err2:
#ifdef HAS_FCHDIR
	(void)close(fd);
#endif
	errno = serrno;
	return (NULL);
#endif
}

#ifndef SV_CWD_RETURN_UNDEF
#define SV_CWD_RETURN_UNDEF \
sv_setsv(sv, &PL_sv_undef); \
return FALSE
#endif

#ifndef OPpENTERSUB_HASTARG
#define OPpENTERSUB_HASTARG     32      /* Called from OP tree. */
#endif

#ifndef dXSTARG
#define dXSTARG SV * targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
                             ? PAD_SV(PL_op->op_targ) : sv_newmortal())
#endif

#ifndef XSprePUSH
#define XSprePUSH (sp = PL_stack_base + ax - 1)
#endif

#ifndef SV_CWD_ISDOT
#define SV_CWD_ISDOT(dp) \
    (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
        (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
#endif

#ifndef getcwd_sv
/* Taken from perl 5.8's util.c */
#define getcwd_sv(a) Perl_getcwd_sv(aTHX_ a)
int Perl_getcwd_sv(pTHX_ register SV *sv)
{
#ifndef PERL_MICRO

#ifndef INCOMPLETE_TAINTS
    SvTAINTED_on(sv);
#endif

#ifdef HAS_GETCWD
    {
	char buf[MAXPATHLEN];

	/* Some getcwd()s automatically allocate a buffer of the given
	 * size from the heap if they are given a NULL buffer pointer.
	 * The problem is that this behaviour is not portable. */
	if (getcwd(buf, sizeof(buf) - 1)) {
	    STRLEN len = strlen(buf);
	    sv_setpvn(sv, buf, len);
	    return TRUE;
	}
	else {
	    sv_setsv(sv, &PL_sv_undef);
	    return FALSE;
	}
    }

#else
  {
    Stat_t statbuf;
    int orig_cdev, orig_cino, cdev, cino, odev, oino, tdev, tino;
    int namelen, pathlen=0;
    DIR *dir;
    Direntry_t *dp;

    (void)SvUPGRADE(sv, SVt_PV);

    if (PerlLIO_lstat(".", &statbuf) < 0) {
	SV_CWD_RETURN_UNDEF;
    }

    orig_cdev = statbuf.st_dev;
    orig_cino = statbuf.st_ino;
    cdev = orig_cdev;
    cino = orig_cino;

    for (;;) {
	odev = cdev;
	oino = cino;

	if (PerlDir_chdir("..") < 0) {
	    SV_CWD_RETURN_UNDEF;
	}
	if (PerlLIO_stat(".", &statbuf) < 0) {
	    SV_CWD_RETURN_UNDEF;
	}

	cdev = statbuf.st_dev;
	cino = statbuf.st_ino;

	if (odev == cdev && oino == cino) {
	    break;
	}
	if (!(dir = PerlDir_open("."))) {
	    SV_CWD_RETURN_UNDEF;
	}

	while ((dp = PerlDir_read(dir)) != NULL) {
#ifdef DIRNAMLEN
	    namelen = dp->d_namlen;
#else
	    namelen = strlen(dp->d_name);
#endif
	    /* skip . and .. */
	    if (SV_CWD_ISDOT(dp)) {
		continue;
	    }

	    if (PerlLIO_lstat(dp->d_name, &statbuf) < 0) {
		SV_CWD_RETURN_UNDEF;
	    }

	    tdev = statbuf.st_dev;
	    tino = statbuf.st_ino;
	    if (tino == oino && tdev == odev) {
		break;
	    }
	}

	if (!dp) {
	    SV_CWD_RETURN_UNDEF;
	}

	if (pathlen + namelen + 1 >= MAXPATHLEN) {
	    SV_CWD_RETURN_UNDEF;
	}

	SvGROW(sv, pathlen + namelen + 1);

	if (pathlen) {
	    /* shift down */
	    Move(SvPVX(sv), SvPVX(sv) + namelen + 1, pathlen, char);
	}

	/* prepend current directory to the front */
	*SvPVX(sv) = '/';
	Move(dp->d_name, SvPVX(sv)+1, namelen, char);
	pathlen += (namelen + 1);

#ifdef VOID_CLOSEDIR
	PerlDir_close(dir);
#else
	if (PerlDir_close(dir) < 0) {
	    SV_CWD_RETURN_UNDEF;
	}
#endif
    }

    if (pathlen) {
	SvCUR_set(sv, pathlen);
	*SvEND(sv) = '\0';
	SvPOK_only(sv);

	if (PerlDir_chdir(SvPVX(sv)) < 0) {
	    SV_CWD_RETURN_UNDEF;
	}
    }
    if (PerlLIO_stat(".", &statbuf) < 0) {
	SV_CWD_RETURN_UNDEF;
    }

    cdev = statbuf.st_dev;
    cino = statbuf.st_ino;

    if (cdev != orig_cdev || cino != orig_cino) {
	Perl_croak(aTHX_ "Unstable directory path, "
		   "current directory changed unexpectedly");
    }

    return TRUE;
  }
#endif

#else
    return FALSE;
#endif
}

#endif


MODULE = Cwd		PACKAGE = Cwd

PROTOTYPES: ENABLE

void
fastcwd()
PROTOTYPE: DISABLE
PPCODE:
{
    dXSTARG;
    getcwd_sv(TARG);
    XSprePUSH; PUSHTARG;
#ifndef INCOMPLETE_TAINTS
    SvTAINTED_on(TARG);
#endif
}

void
abs_path(pathsv=Nullsv)
    SV *pathsv
PROTOTYPE: DISABLE
PPCODE:
{
    dXSTARG;
    char *path;
    char buf[MAXPATHLEN];

    path = pathsv ? SvPV_nolen(pathsv) : (char *)".";

    if (bsd_realpath(path, buf)) {
        sv_setpvn(TARG, buf, strlen(buf));
        SvPOK_only(TARG);
	SvTAINTED_on(TARG);
    }
    else
        sv_setsv(TARG, &PL_sv_undef);

    XSprePUSH; PUSHTARG;
#ifndef INCOMPLETE_TAINTS
    SvTAINTED_on(TARG);
#endif
}

#ifdef WIN32

void
getdcwd(...)
PPCODE:
{
    dXSTARG;
    int drive;
    char *dir;

    /* Drive 0 is the current drive, 1 is A:, 2 is B:, 3 is C: and so on. */
    if ( items == 0 ||
        (items == 1 && (!SvOK(ST(0)) || (SvPOK(ST(0)) && !SvCUR(ST(0))))))
        drive = 0;
    else if (items == 1 && SvPOK(ST(0)) && SvCUR(ST(0)) &&
             isALPHA(SvPVX(ST(0))[0]))
        drive = toUPPER(SvPVX(ST(0))[0]) - 'A' + 1;
    else
        croak("Usage: getdcwd(DRIVE)");

    New(0,dir,MAXPATHLEN,char);
    if (_getdcwd(drive, dir, MAXPATHLEN)) {
        sv_setpvn(TARG, dir, strlen(dir));
        SvPOK_only(TARG);
    }
    else
        sv_setsv(TARG, &PL_sv_undef);

    Safefree(dir);

    XSprePUSH; PUSHTARG;
#ifndef INCOMPLETE_TAINTS
    SvTAINTED_on(TARG);
#endif
}

#endif

--- NEW FILE: Changes ---
Revision history for Perl distribution PathTools.

3.12  Mon Oct  3 22:09:12 CDT 2005

 - Fixed a testing error on OS/2 in which a drive letter for the root
   directory was confusing things. [Ilya Zakharevich]

 - Integrated a patch from bleadperl for fixing path() on
   Win32. [Gisle Aas]

3.11  Sat Aug 27 20:12:55 CDT 2005

 - Fixed a couple of typos in the documentation for
   File::Spec::Mac. [Piotr Fusik]

3.10  Thu Aug 25 22:24:57 CDT 2005

 - eliminate_macros() and fixpath() in File::Spec::VMS are now
   deprecated, since they are MakeMaker-specific and now live inside
   MakeMaker. [Michael Schwern]

 - canonpath() on Win32 now collapses foo/.. (or foo\..) sections
   correctly, rather than doing the "misguided" work it was previously
   doing.  Note that canonpath() on Unix still does NOT collapse these
   sections, as doing so would be incorrect.  [Michael Schwern]

3.09  Tue Jun 14 20:36:50 CDT 2005

 - Added some block delimiters (brackets) in the Perl_getcwd_sv() XS
   function, which were necessary to separate the variable
   declarations from the statements when HAS_GETCWD is not
   defined. [Yves]

 - Apparently the _NT_cwd() routine is never defined externally like I
   thought it was, so I simplified the code around it.

 - When cwd() is implemented using the _backtick_pwd() function, it
   sometimes could create accidental undef entries in %ENV under perl
   5.6, because local($hash{key}) is somewhat broken.  This is now
   fixed with an appropriate workaround. [Neil Watkiss]

3.08  Sat May 28 10:10:29 CDT 2005

 - Fixed a test failure with fast_abs_path() on Windows - it was
   sensitive to the rootdir() change from version 3.07. [Steve Hay]

3.07  Fri May  6 07:46:45 CDT 2005

 - Fixed a bug in which the special perl variable $^O would become
   tainted under certain versions of perl. [Michael Schwern]

 - File::Spec->rootdir() was returning / on Win32.  Now it returns \ .
   [Michael Schwern]

 - We now avoid modifying @_ in tmpdir() when it's not strictly
   necessary, which reportedly provides a modest performance
   boost. [Richard Soderberg]

 - Made a couple of slight changes to the Win32 code so that it works
   (or works better) on Symbian OS phones.  [Jarkko Hietaniemi]

3.06  Wed Apr 13 20:47:26 CDT 2005
 
 (No changes in functionality)

 - Added a note to the canonpath() docs about why it doesn't collapse
   foo/../bar sections.

 - The internal-only function bsd_realpath() in the XS file now uses
   normal arg syntax instead of K&R syntax. [Nicholas Clark]

3.05  Mon Feb 28 07:22:58 CST 2005

 - Fixed a bug in fast_abs_path() on Win32 in which forward- and
   backward-slashes were confusing things. [demerphq]

 - Failure to load the XS code in Cwd is no longer a fatal error
   (though failure to compile it is still a fatal error in the build
   process).  This lets Cwd work under miniperl in the core. [Rafael
   Garcia-Suarez]

 - In the t/cwd.t test, don't enforce loading from blib/ if we're
   testing in the perl core. [Rafael Garcia-Suarez]

3.04  Sun Feb  6 17:27:38 CST 2005

 - For perls older than 5.006, the HAS_GETCWD symbol is not available,
   because it wasn't checked for in older Configure scripts when perl
   was built.  We therefore just ask the user whether the getcwd() C
   function is defined on their platform when their perl is old.
   Maybe in the future we'll try to automate this. [Reported by
   several parties]

 - Remove lib/ppport.h from the distribution, so that MakeMaker
   doesn't accidentally pick it up and install it as a lib
   file. [Jerry Hedden]

 - Fixed a testing error on VMS that occurred when a user had
   read-access to the root of the current volume. [Craig A. Berry]

3.03  Fri Jan 21 21:44:05 CST 2005

 - Fixed a testing error if the first file we find in the root
   directory is a symlink. [Blair Zajac]

 - Added a test to make sure Cwd.pm is loaded from blib/ during
   testing, which seems to be an issue in some people's environments
   and makes it awfully hard to debug things on my end.

 - Skip the _perl_abs_path() tests on Cygwin - they don't usually
   pass, and this function isn't used there anyway, so I decided not
   to push it.  Let 'em use `cwd`.

3.02  Sun Jan  9 19:29:52 CST 2005

 - Fixed a bug in which Cwd::abs_path() called on a file in the root
   directory returned strange results. [Bob Luckin]

 - Straightened out the licensing details for the portion of the Cwd
   module that comes from BSD sources. [Hugo van der Sanden]

 - Removed the prototype from _perl_abs_path() and the XS version of
   abs_path(), since all they seemed to be doing was causing people
   grief, and since some platforms didn't have them anyway.

 - Fixed a testing bug in which sometimes the wrong version of Cwd
   (the version already installed on the user's machine) would get
   loaded instead of the one we're building & installing.

 - Sometimes getdcwd() returns a lower-case drive letter, so don't
   require an upper-case letter in t/win32.t. [Jan Dubois]

 - Fixed a memory leak in getdcwd() on win32. [Steve Hay]

 - Added a copy of ppport.h to the distribution to aid compilation on
   older versions of perl. [Suggested by Charlie Root]

 - Don't bother looking for a 'pwd' executable on MSWin32 - there
   won't be one, and looking for it can be extremely slow when lots of
   disks are mounted. [Several people, including Andrew Burke]

 - Eliminated a multi-argument form of open() that was causing a
   syntax error on older versions of perl. [Fixed by Michael Schwern]

 - The bug-fix changes for revision 0.90 of File::Spec somehow were
   lost when I merged it into the PathTools distribution.  They're
   restored now. [Craig A. Berry]

 - File::Spec->canonpath() will now reduce paths like '[d1.-]foo.dat'
   down to '[000000]foo.dat' instead of '[]foo.dat' or 'foo.dat'.
   This is in better accordance with the native filename syntax
   parser. [Craig A. Berry]

 - In order to remove a recursive dependency (PathTools -> Test-Simple
   -> Test-Harness -> PathTools), we now include a copy of Test::More in
   the distribution.  It is only used for testing, it won't be installed
   with the rest of the stuff.

 - Removed some 5.6-isms from Cwd in order to get it to build with
   older perls like 5.005.

 - abs_path() on Windows was trampling on $ENV{PWD} - fixed. [Spotted
   by Neil MacMullen]

 - Added licensing/copyright statements to the POD in each .pm
   file. [Spotted by Radoslaw Zielinski]

3.01  Mon Sep  6 22:28:06 CDT 2004

 - Removed an unnecessary and confusing dependency on File::Spec from
   the Makefile.PL and the Build.PL.

 - Added a 'NAME' entry to the Makefile.PL, because otherwise it won't
   even begin to work. [Reported by many]

3.00  Thu Sep  2 22:15:07 CDT 2004

 - Merged Cwd and File::Spec into a single PathTools distribution.
   This was done because the two modules use each other fairly
   extensively, and extracting the common stuff into another
   distribution was deemed nigh-impossible.  The code in revision 3.00
   of PathTools should be equivalent to the code in Cwd 2.21 and
   File::Spec 0.90.

==================================================================
Prior to revision 3.00, Cwd and File::Spec were maintained as two
separate distributions.  The revision history for Cwd is shown here.
The revision history for File::Spec is further below.
==================================================================

Cwd 2.21  Tue Aug 31 22:50:14 CDT 2004

 - Removed "NO_META" from the Makefile.PL, since I'm not building the
   distribution with MakeMaker anyway.  [Rohan Carly]

 - Only test _perl_abs_path() on platforms where it's expected to work
   (platforms with '/' as the directory separator). [Craig A. Berry]

Cwd 2.20  Thu Jul 22 08:23:53 CDT 2004

 - On some implementations of perl on Win32, a memory leak (or worse?)
   occurred when calling getdcwd().  This has been fixed. [PodMaster]

 - Added tests for getdcwd() on Win32.

 - Fixed a problem in the pure-perl implementation _perl_abs_path()
   that caused a fatal error when run on plain files. [Nicholas Clark]
   To exercise the appropriate test code on platforms that wouldn't
   otherwise use _perl_abs_path(), run the tests with $ENV{PERL_CORE}
   or $ENV{TEST_PERL_CWD_CODE} set.

Cwd 2.19  Thu Jul 15 08:32:18 CDT 2004

 - The abs_path($arg) fix from 2.18 didn't work for VMS, now it's
   fixed there. [Craig Berry]

Cwd 2.18  Thu Jun 24 08:22:57 CDT 2004

 - Fixed a problem in which abs_path($arg) on some platforms could
   only be called on directories, and died when called on files.  This
   was a problem in the pure-perl implementation _perl_abs_path().

 - Fixed fast_abs_path($arg) in the same way as abs_path($arg) above.

 - On Win32, a function getdcwd($vol) has been added, which gets the
   current working directory of the specified drive/volume.
   [Steve Hay]

 - Fixed a problem on perl 5.6.2 when built with the MULTIPLICITY
   compile-time flags. [Yitzchak Scott-Thoennes]

 - When looking for a `pwd` system command, we no longer assume the
   path separator is ':'.

 - On platforms where cwd() is implemented internally (like Win32),
   don't look for a `pwd` command externally.  This can greatly speed
   up load time.  [Stefan Scherer]

 - The pure-perl version of abs_path() now has the same prototype as
   the XS version (;$).

Cwd 2.17  Wed Mar 10 07:55:36 CST 2004

 - The change in 2.16 created a testing failure when tested from
   within a path that contains symlinks (for instance, /tmp ->
   /private/tmp).

Cwd 2.16  Sat Mar  6 17:56:31 CST 2004

 - For VMS compatibility (and to conform to Cwd's documented
   interface), in the regression tests we now compare output results
   to an absolute path. [Craig A. Berry]

Cwd 2.15  Fri Jan 16 08:09:44 CST 2004

 - Fixed a problem on static perl builds - while creating
   Makefile.aperl, it was loading a mismatched version of Cwd from
   blib/ . [Reported by Blair Zajac]

Cwd 2.14  Thu Jan  8 18:51:08 CST 2004

 - We now use File::Spec->canonpath() and properly-escaped regular
   expressions when comparing paths in the regression tests.  This
   fixes some testing failures in 2.13 on non-Unix platforms.  No
   changes were made in the actual Cwd module code. [Steve Hay]

Cwd 2.13  Fri Jan  2 22:29:42 CST 2004

 - Changed a '//' comment to a '/* */' comment in the XS code, so that
   it'll compile properly under ANSI C rules. [Jarkko Hietaniemi]

 - Fixed a 1-character buffer overrun problem in the C code. [The BSD
   people]

Cwd 2.12  Fri Dec 19 17:04:52 CST 2003

 - Fixed a bug on Cygwin - the output of realpath() should have been
   tainted, but wasn't.  [Reported by Tom Wyant]

Cwd 2.10  Mon Dec 15 07:50:12 CST 2003

 (Note that this release was mistakenly packaged as version 2.11, even
 though it had an internal $VERSION variable of 2.10.  Not sure how
 THAT happened...)

 - There was a dependency in the Makefile.PL on Module::Build, which
   isn't necessary.  I've removed it.

Cwd 2.09  Thu Dec 11 20:30:58 CST 2003

 - The module should now build & install using version 5.6 of perl.

 - We now note a build-time dependency on version 0.19 of
   Module::Build, which is necessary because we don't use the standard
   lib/-based file layout.  No version of Module::Build is required if
   you use the Makefile.PL, just if you use the Build.PL .

 - Removed some gratuitous uses of 5.6-isms like our(), with the aim
   of backporting this module to perl 5.005.

 - Simplified all code that autoloads Carp.pm and calls
   carp()/croak().

 - Removed some redundant OS/2 code at the suggestion of Michael
   Schwern and Ilya Zakharevich.

 - Make sure the correct version of Cwd.pm is loaded in the regression
   tests. [Sam Vilain]

Cwd 2.08  Wed Oct 15 20:56 CDT 2003

  - Code extracted from perl 5.8.1 and packaged as a separate CPAN
    release by Ken Williams.

==================================================================
Prior to revision 3.00, Cwd and File::Spec were maintained as two
separate distributions.  The revision history for File::Spec is shown
here.  The revision history for Cwd is above.
==================================================================

File::Spec 0.90  Tue Aug 31 22:34:50 CDT 2004

 - On VMS, directories use vmspath() and files use vmsify(), so
   rel2abs() has to use some 'educated guessing' when dealing with
   paths containing slashes.  [Craig A. Berry]

File::Spec 0.89  Sun Aug 29 19:02:32 CDT 2004

 - Fixed some pathological cases on VMS which broke canonpath() and
   splitdir().  [Richard Levitte and Craig A. Berry]

 - Fixed rel2abs() on VMS when passed a unix-style relative
   path. [Craig A. Berry]

File::Spec 0.88  Thu Jul 22 23:14:32 CDT 2004

 - rel2abs() on Win32 will now use the new Cwd::getdcwd() function, so
   that things like rel2abs('D:foo.txt') work properly when the
   current drive isn't 'D'. This requires Cwd version 2.18.  
   [Steve Hay]

 - Got rid of a redundant double-backslash in a character
   class. [Alexander Farber]

 - Added much markup to pod for enhanced readability. [Andy Lester]

File::Spec 0.87  Fri Dec 19 08:03:28 CST 2003

 - With a one-line change in the tests, backported to perl 5.004.
   [Issue reported by Barry Kemble]

File::Spec 0.86  Fri Sep 26 10:07:39 CDT 2003

 - This is the version released with perl 5.8.1.  It is identical to
   the code in the File::Spec beta 0.85_03.

File::Spec 0.85_03  Mon Sep 15 09:35:53 CDT 2003

 - On VMS, if catpath() receives volume specifiers in both its first
   two arguments, it will now use the volume in the first argument
   only.  Previously it returned a non-syntactical result which
   included both volumes.  This change is the same in spirit to the
   catpath() MacOS change from version 0.85_02.

 - Fixed an abs2rel() bug on VMS - previously
   abs2rel('[t1.t2.t3]file','[t1.t2]') returned '[t3]file', now it
   properly returns '[.t3]file'.

File::Spec 0.85_02  Fri Sep 12 17:11:13 CDT 2003

 - abs2rel() now behaves more consistently across platforms with the
   notion of a volume.  If the volumes of the first and second
   argument (the second argument may be implicit) do not agree, we do
   not attempt to reconcile the paths, and simply return the first
   argument.  Previously the volume of the second argument was
   (usually) ignored, resulting in sometimes-garbage output.

 - catpath() on MacOS now looks for a volume element (i.e. "Macintosh HD:")
   in its first argument, and then its second argument.  The first
   volume found will be used, and if none is found, none will be used.

 - Fixed a problem in abs2rel() on Win32 in which the volume of the
   current working directory would get added to the second argument if
   none was specified.  This might have been somewhat helpful, but it
   was contrary to the documented behavior.  For example,
   abs2rel('C:/foo/bar', '/foo') used to return 'bar', now it returns
   'C:/foo/bar' because there's no guarantee /foo is actually C:/foo .

 - catdir('/', '../') on OS2 previously erroneously returned '//..',
   and now it returns '/'.

File::Spec 0.85_01  Thu Sep 11 16:18:54 CDT 2003

 Working toward 0.86, the version that will be released with perl 5.8.1.

 - The t/rel2abs2rel.t test now is a little friendlier about emitting
   its diagnostic debugging output. [Jarkko Hietaniemi]

 - We now only require() Cwd when it's needed, on demand. [Michael
   Schwern, Tels]

 - Fixed some POD errors and redundancies in OS2.pm and Cygwin.pm.
   [Michael Schwern]

 - The internal method cwd() has been renamed to _cwd(), since it was
   never meant for public use. [Michael Schwern]

 - Several methods in File::Spec::Unix that just return constant
   strings have been sped up.  catdir() has also been sped up there.
   [Tels]

 - Several canonpath() and catdir() bugs on Win32 have been fixed, and
   tests added for them:
      catdir('/', '../')   -> '\\'     (was '\..')
      catdir('/', '..\\')  -> '\\      (was '')
      canonpath('\\../')   -> '\\'     (was '')
      canonpath('\\..\\')  -> '\\'     (was '')
      canonpath('/../')    -> '\\'     (was '\..')
      canonpath('/..\\')   -> '\\'     (was '')
      catdir('\\', 'foo')  -> '\foo'   (was '\\foo')

 - catpath($volume, $dirs, $file) on Mac OS now ignores any volume
   that might be part of $dirs, enabling catpath($volume,
   catdir(rootdir(), 'foo'), '') to work portably across platforms.

File::Spec 0.85  Tue Jul 22 11:31 CDT 2003

 A bug-fix release relative to 0.84.  I've forked development into a
 "stable" branch (this one) and a more aggressive branch (as yet
 unreleased), with an eye toward getting the stable features in perl
 5.8.1.

 - File::Spec::Mac->case_tolerant() returned 0 when it should have
   returned 1.

 - Many cases in File::Spec::Win32->abs2rel() were broken, because of
   the way in which volumes were/weren't ignored.  Unfortunately, part
   of the regression tests were broken too.  Now, if the $path
   argument to abs2rel() is on a different volume than the $base
   argument, the result will be an absolute path rather than the
   broken relative path previous versions returned.

 - Fixed a problem in File::Spec::Win32->canonpath, which was turning
   \../foo into "foo" rather than \foo

 - Greatly simplified the code in File::Spec::Unix->splitdir().

File::Spec 0.84_01  Fri Jul 11 16:14:29 CDT 2003

 No actual code changes, just changes in other distribution files

 - Dependencies are now listed explicitly in the Makefile.PL and
   Build.PL scripts, as well as in the META.yml file.

 - The t/abs2rel2abs.t test should now be more friendly about skipping
   on platforms where it can't run properly.

File::Spec 0.84  Wed Jul  9 22:21:23 CDT 2003

 I (Ken)'ve taken the changes from bleadperl and created a new CPAN release
 from them, since they're pretty important changes.  The highlights,
 from what I can tell, are listed here.

 - A huge number of changes to File::Spec::Mac in order to bring it in
   line with the other platforms.  This work was mostly/completely
   done by Thomas Wegner.

 - The Epoc and Cygwin platforms are now supported.

 - Lots of generically-applicable documentation has been taken from
   File::Spec::Unix and put in File::Spec.

 - A Build.PL has been provided for people who wish to install via
   Module::Build.

 - Some spurious warnings and errors in the tests have been
   eliminated. [Michael Schwern]

 - canonpath() on File::Spec::Unix now honors a //node-name at the
   beginning of a path.

 - Cwd.pm wasn't being loaded properly on MacOS. [Chris Nandor]

 - Various POD fixups

 - Several testing patches for the Epoc and Cygwin platforms [Tels]

 - When running under taint mode and perl >= 5.8, all the tmpdir()
   implementations now avoid returning a tainted path.

 - File::Spec::OS2 now implements canonpath(), splitpath(),
   splitdir(), catpath(), abs2rel(), and rel2abs() directly rather
   than inheriting them from File::Spec::Unix.

 - Added 'SYS:/temp' and 'C:/temp' to the list of possible tmpdir()s
   on Win32.

 - catfile() on Win32 and VMS will now automatically call canonpath()
   on its final argument.

 - canonpath() on Win32 now does a much more extensive cleanup of the
   path.

 - abs2rel() on Win32 now defaults to using cwd() as the base of
   relativity when no base is given.

 - abs2rel() on Win32 now explicitly ignores any volume component in
   the $path argument.

 - canonpath() on VMS now does []foo ==> foo, and foo.000000] ==> foo].
   It also fixes a bug in multiple [000000.foo ==> [foo translations.

 - tmpdir() on VMS now uses 'sys$scratch:' instead of 'sys$scratch'.

 - abs2rel() on VMS now uses '000000' in both the path and the base.

File::Spec 0.82 Wed Jun 28 11:24:05 EDT 2000
   - Mac.pm: file_name_is_absolute( '' ) now returns TRUE on all platforms
   - Spec.pm: unbreak C<$VERSION = '0.xx'> to be C<$VERSION = 0.xx>, so
     underscores can be used when I want to update CPAN without anyone
     needing to update the perl repository.
   - abs2rel, rel2abs doc tweaks
   - VMS.pm: get $path =~ /\s/ checks from perl repository.
   - Makefile.PL: added INSTALLDIRS => 'perl', since these are std. modules.
   - Remove vestigial context prototypes from &rel2abs until some future
     arrives where method prototypes are honored.

--- NEW FILE: Makefile.PL ---
use ExtUtils::MakeMaker;
WriteMakefile(
    NAME    => 'Cwd',
    VERSION_FROM => '../../lib/Cwd.pm',
);

--- NEW FILE: ppport.h ---
#if 0
<<'SKIP';
#endif
/*
----------------------------------------------------------------------

    ppport.h -- Perl/Pollution/Portability Version 3.06 
   
    Automatically created by Devel::PPPort running under
    perl 5.009003 on Fri May 20 22:14:30 2005.
    
    Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
    includes in parts/inc/ instead.
 
    Use 'perldoc ppport.h' to view the documentation below.

----------------------------------------------------------------------

SKIP
[...4857 lines suppressed...]

#ifdef NO_XSLOCKS
#  ifdef dJMPENV
#    define dXCPT             dJMPENV; int rEtV = 0
#    define XCPT_TRY_START    JMPENV_PUSH(rEtV); if (rEtV == 0)
#    define XCPT_TRY_END      JMPENV_POP;
#    define XCPT_CATCH        if (rEtV != 0)
#    define XCPT_RETHROW      JMPENV_JUMP(rEtV)
#  else
#    define dXCPT             Sigjmp_buf oldTOP; int rEtV = 0
#    define XCPT_TRY_START    Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
#    define XCPT_TRY_END      Copy(oldTOP, top_env, 1, Sigjmp_buf);
#    define XCPT_CATCH        if (rEtV != 0)
#    define XCPT_RETHROW      Siglongjmp(top_env, rEtV)
#  endif
#endif

#endif /* _P_P_PORTABILITY_H_ */

/* End of File ppport.h */




More information about the dslinux-commit mailing list