X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=hivex%2Fhivexsh.c;h=39ca634aa099df8a9274c7f57c798013f124c5ad;hb=43504796252dc8c399f490927008fcbf7d97b27b;hp=ceb115362d5ce90676b98476dc4a5a2d7365a9c6;hpb=3113582ef88d280cfa3c479cc705c3972c777fb7;p=libguestfs.git diff --git a/hivex/hivexsh.c b/hivex/hivexsh.c index ceb1153..39ca634 100644 --- a/hivex/hivexsh.c +++ b/hivex/hivexsh.c @@ -559,10 +559,14 @@ cmd_cd (char *path) continue; } + errno = 0; new_cwd = hivex_node_get_child (h, new_cwd, elem); if (new_cwd == 0) { - fprintf (stderr, _("hivexsh: cd: subkey '%s' not found\n"), - elem); + if (errno) + perror ("hivexsh: cd"); + else + fprintf (stderr, _("hivexsh: cd: subkey '%s' not found\n"), + elem); return -1; } }