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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]