Posix.realpath has incorrect prototype

Bug #1154853 reported by Sergio Costas
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
vala-0.18 (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Trying to use Posix.realpath with a code like:

    string tmp;
    tmp=Posix.realpath(this.config_path);

is compiled to:

    _tmp35_ = realpath (_tmp34_, NULL, 0);

which fails with error:

    .vala.c:920:2: error: too many argument for function ‘realpath’

because 'realpath' needs only two parameters, not three.

This error exists in both Vala 0.16 and 0.18.

The fix (pointed by Jonas Kulla) is to modify the prototype in posix.vapi to:

    [CCode (cheader_filename = "stdlib.h")]
    public string? realpath (string path, [CCode (array_length=false)] uint8[]?
resolved_path = null);

This bug also applies to vala 0.16, so I will open a new bug report there and attach the diff.

Tags: patch
Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "posix.realpath.vala_0.18.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in vala-0.18 (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in vala-0.18 (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.