[Python-checkins] r80816 - python/trunk/Python/getcwd.c
brett.cannon
python-checkins at python.org
Wed May 5 22:26:58 CEST 2010
Author: brett.cannon
Date: Wed May 5 22:26:58 2010
New Revision: 80816
Log:
Remove an unneeded variable and fix a little whitespace.
Found using Clang's static analyzer.
Modified:
python/trunk/Python/getcwd.c
Modified: python/trunk/Python/getcwd.c
==============================================================================
--- python/trunk/Python/getcwd.c (original)
+++ python/trunk/Python/getcwd.c Wed May 5 22:26:58 2010
@@ -28,7 +28,7 @@
{
char localbuf[MAXPATHLEN+1];
char *ret;
-
+
if (size <= 0) {
errno = EINVAL;
return NULL;
@@ -59,14 +59,13 @@
{
FILE *fp;
char *p;
- int sts;
if (size <= 0) {
errno = EINVAL;
return NULL;
}
if ((fp = popen(PWD_CMD, "r")) == NULL)
return NULL;
- if (fgets(buf, size, fp) == NULL || (sts = pclose(fp)) != 0) {
+ if (fgets(buf, size, fp) == NULL || pclose(fp) != 0) {
errno = EACCES; /* Most likely error */
return NULL;
}
More information about the Python-checkins
mailing list