[haiku-bugs] [Haiku] #9931: Allocate returned buffer in realpath() in case resolved_name's argument is NULL

  • From: "oco" <trac@xxxxxxxxxxxx>
  • Date: Sat, 17 Aug 2013 21:57:35 -0000

#9931: Allocate returned buffer in realpath() in case resolved_name's argument 
is
NULL
-------------------------------+---------------------------
 Reporter:  oco                |        Owner:  axeld
     Type:  enhancement        |       Status:  new
 Priority:  normal             |    Milestone:  R1
Component:  System/libroot.so  |      Version:  R1/alpha4.1
 Keywords:  realpath           |   Blocked By:
 Blocking:                     |  Has a Patch:  0
 Platform:  All                |
-------------------------------+---------------------------
 Add support for NULL as resolved_name argument in realpath as defined in
 The Open Group Base Specifications Issue 7 IEEE Std 1003.1, 2013 Edition
 (http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html).

 In this case, the returned buffer is allocated by realpath and can be
 passed to free().

 The behavior was only "implementation defined" in previous revision like
 The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition
 (http://pubs.opengroup.org/onlinepubs/000095399/functions/realpath.html).

 Yodl (http://yodl.sourceforge.net/) rely on this behavior in
 yodl/src/lexer/lchdir.c.

--
Ticket URL: <http://dev.haiku-os.org/ticket/9931>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: