From cb9ee701ef46c1819eed4e2a4dc181682bdfc176 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 10 Feb 2021 21:16:39 +0000 Subject: [PATCH 1/3] gkeyfilesettingsbackend: Fix basename handling when group is unset Fix an effective regression in commit 7781a9cbd2fd0aa84bee0f4eee88470640ff6706, which happens when `convert_path()` is called with a `key` which contains no slashes. In that case, the `key` is entirely the `basename`. Prior to commit 7781a9cb, the code worked through a fluke of `i == -1` cancelling out with the various additions in the `g_memdup()` call, and effectively resulting in `g_strdup (key)`. Spotted by Guido Berhoerster. Signed-off-by: Philip Withnall --- gio/gkeyfilesettingsbackend.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c index 25b057672..861c3a661 100644 --- a/gio/gkeyfilesettingsbackend.c +++ b/gio/gkeyfilesettingsbackend.c @@ -185,7 +185,12 @@ convert_path (GKeyfileSettingsBackend *kfsb, } if (basename) - *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key)); + { + if (last_slash != NULL) + *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key)); + else + *basename = g_strdup (key); + } return TRUE; } -- 2.30.1 c/snippets?id=4030ab515bd91a5c2ad09d34ff9328120542587b'>diff
AgeCommit message (Expand)Author
2022-01-19etc: Match define-public only at line start....The current regexp simply matches the first occurence, which more often than not points to the *previous* variable. * etc/snippets/text-mode/guix-commit-message-update-package ($1): Restrict match to beginning of line with optional indentation. Liliana Marie Prikler
2021-06-26etc: snippets: Use ‘hg-file-name’ when origin uses ‘hg-fetch’...Adjust to changes in commit aaafd19bd1e37265de07e246286a6819792c25b4. * etc/snippets/scheme-mode/guix-origin: Use ‘hg-file-name’ instead of ‘string-append’ when ‘method’ for origin is ‘hg-fetch’. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Xinglu Chen
2020-12-23etc: snippets: Add new build systems to package snippet....* etc/snippets/scheme-mode/guix-package: Add the following as possibilities for the build-system field: clojure-build-system copy-build-system dune-build-system guile-build-system julia-build-system linux-module-build-system maven-build-system node-build-system qt-build-system rakudo-build-system Signed-off-by: Ludovic Courtès <ludo@gnu.org> Morgan Smith
2020-12-04etc: snippets: Fix name extraction....* etc/snippets/text-mode/guix-commit-message-add-package: Fix name extraction. This is a follow-up to 988a49c78ef19ad25cef543e2059a19db04bbd36. Nicolas Goaziou
2020-12-04etc: snippets: Fix name extraction....* etc/snippets/text-mode/guix-commit-message-update-package: Since git commit mode is not derived from any Lisp mode, so-called sexp or symbols do not include the period character. As a consequence, names including versions are not properly extracted. Also use more idiomatic (goto-char (point-min)) instead of (beginning-of-buffer). Nicolas Goaziou
2020-11-25etc: snippets: Fix "gnu: Add ..." name when prefilling Common Lisp commits me......* etc/snippets/text-mode/guix-commit-message-add-cl-package: Fix name and simplify the "New variables" line. Pierre Neidhardt
2020-11-23etc: snippets: Prefill Common Lisp package names....* etc/snippets/text-mode/guix-commit-message-add-cl-package: New file. Pierre Neidhardt
2020-11-23etc: snippets: Fix package name extraction....* etc/snippets/text-mode/guix-commit-message-add-package: Properly extract name when the diff contains a very short `define-public ...` above the actual new package. This can happen when the above package is a small inherited definition or cl/ecl package. Pierre Neidhardt
2019-05-09Add (guix bzr-download)....* guix/bzr-download.scm, guix/build/bzr.scm, etc/snippets/scheme-mode/guix-bzr-reference: New files. * Makefile.am (MODULES): Add them. * etc/snippets/scheme-mode/guix-origin: Add "bzr-fetch" to the origin choices. Maxim Cournoyer
2019-03-26etc: Add "rename" snippet....* etc/snippets/text-mode/guix-commit-message-rename-package: New file. Pierre Neidhardt