After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 617416 - Don't use PATH_MAX for portability reasons
Don't use PATH_MAX for portability reasons
Status: RESOLVED FIXED
Product: GEGL
Classification: Other
Component: build
0.0.22
Other Linux
: Normal normal
: ---
Assigned To: Default Gegl Component Owner
Depends on:
Blocks: 642366
 
 
Reported: 2010-05-02 08:16 UTC by Emilio Pozuelo Monfort
Modified: 2011-03-28 21:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use dynamic allocation rather than fixed size PATH_MAX buffers (4.24 KB, patch)
2010-05-02 08:16 UTC, Emilio Pozuelo Monfort
none Details | Review
Updated patch (2.95 KB, patch)
2011-02-19 22:11 UTC, Emilio Pozuelo Monfort
none Details | Review

Description Emilio Pozuelo Monfort 2010-05-02 08:16:03 UTC
Hi,

PATH_MAX is not very portable, as POSIX doesn't mandate it. This cases build failures on some platforms, e.g. on GNU/Hurd, where PATH_MAX is undefined (since there's no path length limit).

The attached patch uses dynamic allocation instead of PATH_MAX. realpath() NULL argument usage is standard since POSIX.2008, but I dunno whether _fullpath() (used in Windows) accepts it.

When bug 111848 is fixed, it would probably be a good idea to use the GLib function.
Comment 1 Emilio Pozuelo Monfort 2010-05-02 08:16:59 UTC
Created attachment 160125 [details] [review]
Use dynamic allocation rather than fixed size PATH_MAX buffers
Comment 2 Martin Nordholts 2011-02-16 17:39:52 UTC
Can you rebase this patch on latest git master and use "git format-patch -1" to generate the patch please? It doesn't apply cleanly any longer.
Comment 3 Emilio Pozuelo Monfort 2011-02-19 22:11:58 UTC
Created attachment 181360 [details] [review]
Updated patch

Patch against git.

I haven't been able to build git master as it requires some stuff that is too new for me. Please let me know if there are any issues with it.
Comment 4 Jon Nordby 2011-03-28 21:48:35 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

I pushed your patch, but added in removal of another PATH_MAX + realpath usage that had snuck in: http://git.gnome.org/browse/gegl/commit/?id=7d12e628b7fc112ee7a7b6ac7bcf79cd529d00e4

Thanks!