Tcl Source Code

Check-in [2209610f60]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove AbsolutePath(), no longer used.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core_zip_vfs
Files: files | file ages | folders
SHA3-256:2209610f60c7317112a0f001bdfe570d4287298c3a12ce2e6980cdbbb74c3723
User & Date: dgp 2018-06-12 19:16:38
Context
2018-06-12
19:32
Adding typecasts in tclZipfs.c to eliminate a compiler warning check-in: ebd55b94e1 user: hypnotoad tags: core_zip_vfs
19:16
Remove AbsolutePath(), no longer used. check-in: 2209610f60 user: dgp tags: core_zip_vfs
19:14
merge 8.7 check-in: c99f22f840 user: dgp tags: core_zip_vfs
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclZipfs.c.

753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
    }
    if (j == 0) {
        path[j++] = '/';
    }
    path[j] = 0;
    Tcl_DStringSetLength(dsPtr, j);
    result=Tcl_DStringValue(dsPtr);
    return result;
}
 

/*
 *-------------------------------------------------------------------------
 *
 * AbsolutePath --
 *
 *        This function computes the absolute path from a given
 *        (relative) path name into the specified Tcl_DString.
 *
 * Results:
 *        Returns the pointer to the absolute path contained in the
 *        specified Tcl_DString.
 *
 * Side effects:
 *        Modifies the specified Tcl_DString.
 *
 *-------------------------------------------------------------------------
 */

static char *
AbsolutePath(const char *path,
#if HAS_DRIVES
             int *drvPtr,
#endif
             Tcl_DString *dsPtr)
{
    char *result;

#if HAS_DRIVES
    if (drvPtr != NULL) {
        *drvPtr = 0;
    }
#endif
    if (*path == '~') {
        Tcl_DStringAppend(dsPtr, path, -1);
        return Tcl_DStringValue(dsPtr);
    }
    if ((*path != '/')
#if HAS_DRIVES
        && (*path != '\\') &&
        (((*path != '\0') && (strchr(drvletters, *path) == NULL)) ||
         (path[1] != ':'))
#endif
        ) {
        Tcl_DString pwd;

        /* relative path */
        Tcl_DStringInit(&pwd);
        Tcl_GetCwd(NULL, &pwd);
        result = Tcl_DStringValue(&pwd);
#if HAS_DRIVES
        if ((result[0] != '\0') && (strchr(drvletters, result[0]) != NULL) &&
            (result[1] == ':')) {
            if (drvPtr != NULL) {
                drvPtr[0] = result[0];
                if ((drvPtr[0] >= 'a') && (drvPtr[0] <= 'z')) {
                    drvPtr[0] -= 'a' - 'A';
                }
            }
            result += 2;
        }
#endif
        result = CanonicalPath(result, path, dsPtr, 0);
        Tcl_DStringFree(&pwd);
    } else {
        /* absolute path */
#if HAS_DRIVES
        if ((path[0] != '\0') && (strchr(drvletters, path[0]) != NULL) &&
            (path[1] == ':')) {
            if (drvPtr != NULL) {
                drvPtr[0] = path[0];
                if ((drvPtr[0] >= 'a') && (drvPtr[0] <= 'z')) {
                    drvPtr[0] -= 'a' - 'A';
                }
            }
        }
#endif
        result = CanonicalPath("", path, dsPtr, 0);
    }
    return result;
}
 
/*
 *-------------------------------------------------------------------------
 *
 * ZipFSLookup --







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







753
754
755
756
757
758
759


















































































760
761
762
763
764
765
766
    }
    if (j == 0) {
        path[j++] = '/';
    }
    path[j] = 0;
    Tcl_DStringSetLength(dsPtr, j);
    result=Tcl_DStringValue(dsPtr);


















































































    return result;
}
 
/*
 *-------------------------------------------------------------------------
 *
 * ZipFSLookup --