Jump to content
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

Transition Impacts

Tru64 UNIX Software Transition Kit
» 

DSPP Home

» HP STK home
Tru64 UNIX STK
» Home
» Overview
» Tools
» Documentation
» Transition impacts
» Identifier types
» Impact list
» Porting to HP-UX
» FAQ
» Glossary
» Help
» Send us feedback
Site maps
» Tru64 UNIX STK
» DSPP
Content starts here

non-critical impact:

basename and dirname - different behavior for default versions (NcWn190)

UN Impacts

Problem description

Two versions of the basename and dirname functions exist in Tru64 UNIX. The standard versions (with _XOPEN_SOURCE_EXTENDED defined) are the same as the corresponding HP-UX versions. The default versions differ from HP-UX in behavior.

The basename and dirname functions return the base filename or directory portion of a pathname, respectively.

On Tru64 UNIX, applications that are compiled in an environment that excludes the _XOPEN_SOURCE_EXTENDED standard definitions have the following exclusive behaviors:

  • The basename function returns an empty string if the string consists entirely of the / (slash) character.

  • If the path argument is a null pointer, basename dumps core, unless a handler has been set.

  • If the path argument points to an empty string, basename returns an empty string.

  • The dirname function returns a NULL if there is no / (slash).

  • If no handler has been set, dirname dumps core if path is a null pointer, or if the path argument points to an empty string.

Identifiers

C/C++ Functionsbasename C/C++ Functionsdirname      

See also

Solution description

Review the applicable manpages and code.

The documented Tru64 UNIX specific behaviors may or may not affect your application. Review the applicable manpages and your code to determine if unexpected behavior will result.

See also


Problem summary

classifications source types OS release severity type
UN C, C++ any HP-UX 11i version non-critical warning
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.