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 6d96e53Copy full SHA for 6d96e53
src/clib-install.c
@@ -306,7 +306,15 @@ 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
+ size_t length = version_char - slug;
313
+ pkg->repo = malloc(sizeof(char) * length);
314
+ memcpy(pkg->repo, slug, length);
315
+ } else {
316
+ pkg->repo = strdup(slug);
317
+ }
318
319
320
if (!opts.nosave) {
0 commit comments