[libvirt] [sandbox] Get gvir_sandbox_util_guess_image_format search for the last '.'

Cédric Bosdonnat cbosdonnat at suse.com
Wed Jul 1 12:46:14 UTC 2015


gvir_sandbox_util_guess_image_format is failing to find the extension
in paths like /tmp/tmp.mg0tQ1JLFl/mine.img
---
 libvirt-sandbox/libvirt-sandbox-util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libvirt-sandbox/libvirt-sandbox-util.c b/libvirt-sandbox/libvirt-sandbox-util.c
index 6385291..d73fc8b 100644
--- a/libvirt-sandbox/libvirt-sandbox-util.c
+++ b/libvirt-sandbox/libvirt-sandbox-util.c
@@ -40,7 +40,7 @@ gint gvir_sandbox_util_guess_image_format(const gchar *path,
 {
     gchar *tmp;
 
-    if ((tmp = strchr(path, '.')) == NULL) {
+    if ((tmp = g_strrstr(path, ".")) == NULL) {
         g_set_error(error, GVIR_SANDBOX_UTIL_ERROR, 0,
                     _("Cannot identify file extension in '%s'"), path);
         return -1;
-- 
2.1.4




More information about the libvir-list mailing list