From: Matthew Fernandez Date: Sat, 19 Mar 2022 20:12:20 +0000 (-0700) Subject: pathcanon: remove unnecessary 'errno' save and restore X-Git-Tag: 4.0.0~165^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b438ebf3964304e9677f4960cf167bc7ff1a58d4;p=graphviz pathcanon: remove unnecessary 'errno' save and restore a3db9ad8f8eb79a931f0bc6d087ca3b52de3dd62 removed any logic in this function that affected `errno`. So there is no need to save and restore it anymore. --- diff --git a/lib/ast/pathcanon.c b/lib/ast/pathcanon.c index 01b02d264..2ce6c7210 100644 --- a/lib/ast/pathcanon.c +++ b/lib/ast/pathcanon.c @@ -21,7 +21,6 @@ */ #include -#include #include char *pathcanon(char *path) { @@ -30,9 +29,7 @@ char *pathcanon(char *path) { char *t; int dots; int loop; - int oerrno; - oerrno = errno; dots = loop = 0; if (*path == '/' && *(path + 1) == '/') do @@ -78,7 +75,6 @@ char *pathcanon(char *path) { && *(t - 1) == '/') t--; *t = 0; - errno = oerrno; return t; } dots = 0;