mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-20 08:56:47 -05:00
utils: use pa_path_get_filename() where applicable
This commit is contained in:
parent
8bada7496c
commit
4d874753f5
3 changed files with 6 additions and 24 deletions
|
|
@ -802,7 +802,6 @@ enum {
|
|||
|
||||
int main(int argc, char *argv[]) {
|
||||
pa_mainloop* m = NULL;
|
||||
char tmp[PATH_MAX];
|
||||
int ret = 1, c;
|
||||
char *server = NULL, *bn;
|
||||
|
||||
|
|
@ -882,17 +881,8 @@ int main(int argc, char *argv[]) {
|
|||
if (optind+2 < argc)
|
||||
sample_name = pa_xstrdup(argv[optind+2]);
|
||||
else {
|
||||
char *f = strrchr(argv[optind+1], '/');
|
||||
size_t n;
|
||||
if (f)
|
||||
f++;
|
||||
else
|
||||
f = argv[optind];
|
||||
|
||||
n = strcspn(f, ".");
|
||||
strncpy(tmp, f, n);
|
||||
tmp[n] = 0;
|
||||
sample_name = pa_xstrdup(tmp);
|
||||
char *f = pa_path_get_filename(argv[optind+1]);
|
||||
sample_name = pa_xstrndup(f, strcspn(f, "."));
|
||||
}
|
||||
|
||||
pa_zero(sfi);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue