X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Fedit.c;h=a010057da403339609a28a8360c0aa037bbe31d3;hp=1b6ce23cac165acf49e25f9c7e58c9d9da6c5d61;hb=3920ad95f6b2db8fbf20aa26692877a09070cb04;hpb=c17ff8145718ed86419a7f6c5000b73dd54e324a;ds=inline diff --git a/fish/edit.c b/fish/edit.c index 1b6ce23..a010057 100644 --- a/fish/edit.c +++ b/fish/edit.c @@ -88,9 +88,9 @@ do_edit (const char *cmd, int argc, char *argv[]) } /* Choose an editor. */ - if (strcasecmp (cmd, "vi") == 0) + if (STRCASEEQ (cmd, "vi")) editor = "vi"; - else if (strcasecmp (cmd, "emacs") == 0) + else if (STRCASEEQ (cmd, "emacs")) editor = "emacs -nw"; else { editor = getenv ("EDITOR"); @@ -149,14 +149,14 @@ do_edit (const char *cmd, int argc, char *argv[]) unlink (filename); /* Changed? */ - if (strlen (content) == size && strncmp (content, content_new, size) == 0) { + if (strlen (content) == size && STREQLEN (content, content_new, size)) { free (content); free (content_new); return 0; } /* Write new content. */ - if (guestfs_write_file (g, argv[0], content_new, size) == -1) { + if (guestfs_write (g, argv[0], content_new, size) == -1) { free (content); free (content_new); return -1;