commit 9ae51b1f41d2c065ee81c81e6f58611ac9ca042e from: Omar Polo date: Sat Sep 02 08:44:35 2023 UTC amused-web: drop -t commit - 03069bc39f4344ac6b078736bc1a1a40d8aa8ef3 commit + 9ae51b1f41d2c065ee81c81e6f58611ac9ca042e blob - 114332657a43551572bd150e1374088a6f49b783 blob + 6628bd2998dd3af957ddbe3f82a08963698bfdb4 --- web/amused-web.1 +++ web/amused-web.1 @@ -22,7 +22,6 @@ .Nm .Op Fl v .Op Fl s Ar socket -.Op Fl t Ar prefix .Op Oo Ar host Oc Ar port .Sh DESCRIPTION .Nm @@ -44,10 +43,6 @@ control socket. By default .Pa /tmp/amused-UID is used. -.It Fl t Ar prefix -Strip -.Ar prefix -from the paths showed on the interface. .It Fl v Produce more verbose output. .El blob - 34624f74845b723d937825aacc834473d1cfd4e6 blob + 6a968b5153e1180b5641e3cf6550148f03d137ac --- web/web.c +++ web/web.c @@ -64,8 +64,6 @@ static struct imsgbuf ibuf; static struct playlist playlist_tmp; static struct player_status player_status; static uint64_t position, duration; -static const char *prefix = ""; -static size_t prefixlen; static void client_ev(int, int, void *); @@ -547,7 +545,7 @@ static void render_playlist(struct client *clt) { ssize_t i; - const char *path, *p; + const char *path; int current; http_writes(clt, "
"); @@ -558,15 +556,13 @@ render_playlist(struct client *clt) for (i = 0; i < playlist.len; ++i) { current = play_off == i; - p = path = playlist.songs[i]; - if (!strncmp(p, prefix, prefixlen)) - p += prefixlen; + path = playlist.songs[i]; http_fmt(clt, "", current ? " id=current" : ""); http_writes(clt, ""); } @@ -974,7 +970,7 @@ web_accept(int psock, int ev, void *d) void __dead usage(void) { - fprintf(stderr, "usage: %s [-v] [-s sock] [-t prefix] [[host] port]\n", + fprintf(stderr, "usage: %s [-v] [-s sock] [[host] port]\n", getprogname()); exit(1); } @@ -999,15 +995,11 @@ main(int argc, char **argv) if (pledge("stdio rpath unix inet dns", NULL) == -1) err(1, "pledge"); - while ((ch = getopt(argc, argv, "s:t:v")) != -1) { + while ((ch = getopt(argc, argv, "s:v")) != -1) { switch (ch) { case 's': sock = optarg; break; - case 't': - prefix = optarg; - prefixlen = strlen(prefix); - break; case 'v': verbose = 1; break;