Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use .get_file() instead of basename from libc #51429

Merged
merged 1 commit into from
Oct 9, 2021

Commits on Oct 8, 2021

  1. use .get_file() instead of basename(3)

    On OpenBSD the compiler complains that calling basename(3) would lose
    const qualifier.  basename(3) is defined as
    
    	char *basename(char *);
    
    and can, accorgindly to the POSIX.1, modify the passed string.
    
    This uses the .get_file() method.  The check is necessary because
    file_name could be a directory, in which case .get_file() would return
    an empty string.  The .get_base_dir().get_file() idiom is already used.
    
    The usage of get_file() and the check were suggested by theraot, thanks!
    omar-polo committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    a3384b7 View commit details
    Browse the repository at this point in the history