We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d987893 commit d6025f5Copy full SHA for d6025f5
src/clib-install.c
@@ -306,7 +306,14 @@ static int install_package(const char *slug) {
306
}
307
308
if (0 == pkg->repo || 0 != strcmp(slug, pkg->repo)) {
309
- pkg->repo = strdup(slug);
+ char* version_char = NULL;
310
+ // NOTE: check if version was specified
311
+ if ((version_char = strchr(slug, '@')) != NULL) {
312
+ pkg->repo = malloc(sizeof(version_char - slug) + 1);
313
+ memcpy(pkg->repo, slug, sizeof(version_char - slug) + 1);
314
+ } else {
315
+ pkg->repo = strdup(slug);
316
+ }
317
318
319
if (!opts.nosave) {
0 commit comments