Skip to content

[MISC] VScript VGUI inconsistently ignores "vgui/" escape on Linux #252

Open
@Blixibon

Description

@Blixibon

Describe the bug

When an image is set in VScript VGUI, this line of code navigates outside of the vgui directory, which is used by default for VGUI images.

V_snprintf( fileName, sizeof( fileName ), "../%s", imageName );

On Linux, this path sometimes does not resolve. A message is printed to the console containing the directory escape as though it was a direct part of the path:

material "vgui/../swarm/ach_weapon_expert_locked" not found

Example of this occurring:

image

However, in some cases, this does not happen and the path successfully navigates to the material outside of the vgui folder.

Steps to reproduce

The circumstances in which this produces an error are not currently known. You can run this simple clientside vscript to create a VGUI image, although it may not produce the error by default.

local panel = vgui.CreatePanel( "ImagePanel", vgui.GetClientDLLRootPanel(), "" );
panel.MakeReadyForUse();
panel.SetVisible( true );
panel.SetPaintEnabled( true );
panel.SetPaintBackgroundEnabled( true );
panel.SetSize( 256, 256 );
panel.SetPos( 0, 0 );
panel.SetImage( "brick/brickfloor001a", false );

Expected behavior

The path should resolve to a material outside of the vgui directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working🐧 LinuxMapbase - Related to Linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions