Changeset 1523


Ignore:
Timestamp:
Sep 28, 2004, 3:46:31 AM (21 years ago)
Author:
bird
Message:

_realrealpath().

Location:
trunk/src/emx
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/InnoTekLIBC/backend.h

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1522 r1523  
    134134 * @param   pszBuf      Where to store the resolved path.
    135135 * @param   cchBuf      Size of the buffer.
    136  * @param   fFlags      At the moment 0. Which means the entire path must exist.
     136 * @param   fFlags      Combination of __LIBC_BACKFS_FLAGS_RESOLVE_* defines.
    137137 */
    138138int __libc_Back_fsPathResolve(const char *pszPath, char *pszBuf, size_t cchBuf, unsigned fFlags);
     139/** Flags for __libc_Back_fsPathResolve().
     140 * @{ */
     141#define __LIBC_BACKFS_FLAGS_RESOLVE_FULL    0
     142/** Get the native path instead, no unix root translations. */
     143#define __LIBC_BACKFS_FLAGS_RESOLVE_NATIVE  0x10
     144/** @} */
     145
    139146
    140147/**
  • trunk/src/emx/include/stdlib.h

    • Property cvs2svn:cvs-rev changed from 1.25 to 1.26
    r1522 r1523  
    292292#ifdef __BSD_VISIBLE
    293293char    *_getcwdux(char *, size_t);
     294/* todo: int     _chdirux(char *); */
     295char    *_realrealpath(const char *, char *, size_t);
    294296#endif
    295297#ifdef  __USE_GNU
  • trunk/src/emx/src/emxomf/emxomfld.c

    • Property cvs2svn:cvs-rev changed from 1.38 to 1.39
    r1522 r1523  
    803803     * Make abspath with slashes the desired way and such.
    804804     */
    805     if (_abspath(pszFullname, pszName, _MAX_PATH + 1))
     805    if (!_realrealpath(pszName, pszFullname, _MAX_PATH + 1))
    806806    {
    807807        printf("emxomfld: _abspath failed on '%s'!!!\n", pszName);
     
    962962                if (phFile)
    963963                {
     964                    char *pszTmp;
    964965                    if (autoconvert_flag)
    965966                    {
     
    968969                        else if (!check_omf(phFile))
    969970                            phFile = aout_to_omf(phFile, pszFullname, TRUE);
     971                    }
     972
     973                    /* Get the real native path. */
     974                    pszTmp = _realrealpath(pszFullname, NULL, 0);
     975                    if (pszTmp)
     976                    {
     977                        strcpy(pszFullname, pszTmp);
     978                        free(pszTmp);
    970979                    }
    971980
     
    11031112        rc = WLDGenerateWeakAliases (pwld, weakobj_fname, weakdef_fname);
    11041113      if (!rc && weakobj_fname[0])
    1105         add_name_list (&add_obj_fnames, weakobj_fname, 0);
     1114        {
     1115          char *pszTmp = _realrealpath(weakobj_fname, NULL, 0);
     1116          if (pszTmp)
     1117          {
     1118              strcpy(weakobj_fname, pszTmp);
     1119              free(pszTmp);
     1120          }
     1121          add_name_list (&add_obj_fnames, weakobj_fname, 0);
     1122        }
    11061123      if (!rc && weakdef_fname[0])
    1107         def_fname = weakdef_fname;
     1124        {
     1125          char *pszTmp = _realrealpath(weakdef_fname, NULL, 0);
     1126          if (pszTmp)
     1127          {
     1128              strcpy(weakdef_fname, pszTmp);
     1129              free(pszTmp);
     1130          }
     1131          def_fname = weakdef_fname;
     1132        }
    11081133
    11091134      /* cleanup the linker */
     
    14241449                  usage ();
    14251450                }
    1426               def_fname = optarg;
     1451              def_fname = _realrealpath(optarg, NULL, 0);
     1452              if (!def_fname)
     1453                def_fname = optarg;
    14271454            }
    14281455
     
    14381465                  usage ();
    14391466                }
    1440               res_fname = optarg;
     1467              res_fname = _realrealpath(optarg, NULL, 0);
     1468              if (!def_fname)
     1469                res_fname = optarg;
    14411470            }
    14421471
  • trunk/src/emx/src/lib/libc.def

    • Property cvs2svn:cvs-rev changed from 1.65 to 1.66
    r1522 r1523  
    11901190    "___libc_Back_fsDriveDefaultGet" @1210
    11911191    "___libc_Back_fsDriveDefaultSet" @1211
     1192    "__realrealpath" @1212
  • trunk/src/emx/src/lib/misc/realpath.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1522 r1523  
    6969                LIBCLOG_RETURN_MSG(psz, "ret %p:{%s}\n", psz, psz);
    7070            }
     71            free(psz);
    7172        }
    7273        else
    7374            rc = -ENOMEM;
    74         free(psz);
    7575    }
    7676    else
  • trunk/src/emx/src/lib/sys/b_fsPathResolve.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1522 r1523  
    3434#include <os2emx.h>
    3535#include "fs.h"
     36#include <errno.h>
    3637#include <string.h>
    3738#include <InnoTekLIBC/backend.h>
     
    4950 * @param   pszBuf      Where to store the resolved path.
    5051 * @param   cchBuf      Size of the buffer.
    51  * @param   fFlags      At the moment 0. Which means the entire path must exist.
     52 * @param   fFlags      Combination of __LIBC_BACKFS_FLAGS_RESOLVE_* defines.
    5253 */
    5354int __libc_Back_fsPathResolve(const char *pszPath, char *pszBuf, size_t cchBuf, unsigned fFlags)
     
    6970    {
    7071        char *pszSrc = &szNativePath[0];
    71         if (fInUnixTree)
     72        if (!(fFlags & __LIBC_BACKFS_FLAGS_RESOLVE_NATIVE) && fInUnixTree)
    7273        {
    7374            pszSrc += __libc_gcchUnixRoot;
     
    7980        if (cch < cchBuf)
    8081        {
    81             /** @todo use DosFindFirst to get the correctly cased path. */
    8282            memcpy(pszBuf, pszSrc, cchBuf);
    8383            LIBCLOG_RETURN_MSG(0, "ret 0 pszPath=%p:{%s}\n", (void *)pszPath, pszPath);
    8484        }
     85        else
     86            rc = -ERANGE;
    8587    }
    8688    else
Note: See TracChangeset for help on using the changeset viewer.