This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Add necessary braces to if statements
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org
- Date: 20 Mar 2016 10:55:33 -0000
- Subject: [newlib-cygwin] Add necessary braces to if statements
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=dc85a189a490d3fdd779da3aae1178aafde37cfc
commit dc85a189a490d3fdd779da3aae1178aafde37cfc
Author: Peter Foley <pefoley2@pefoley.com>
Date: Sat Mar 19 13:45:49 2016 -0400
Add necessary braces to if statements
The missing braces cause only the first expression to be guarded by the
else clause.
winsup/cygwin/ChangeLog
* fhandler_disk_file.cc (facl): Add missing braces to if statement.
* mount.cc (dos_drive_mappings): Add missing braces to if statement.
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
Diff:
---
winsup/cygwin/fhandler_disk_file.cc | 3 ++-
winsup/cygwin/mount.cc | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 470dae8..2cf738f 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -1055,11 +1055,12 @@ cant_access_acl:
case GETACL:
if (!aclbufp)
set_errno(EFAULT);
- else
+ else {
res = getacl (get_stat_handle (), pc, nentries, aclbufp);
/* For this ENOSYS case, see security.cc:get_file_attribute(). */
if (res == -1 && get_errno () == ENOSYS)
goto cant_access_acl;
+ }
break;
case GETACLCNT:
res = getacl (get_stat_handle (), pc, 0, NULL);
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index ece8745..22bc49c 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -1962,7 +1962,7 @@ dos_drive_mappings::dos_drive_mappings ()
HANDLE sh = FindFirstVolumeW (vol, 64);
if (sh == INVALID_HANDLE_VALUE)
debug_printf ("FindFirstVolumeW, %E");
- else
+ else {
do
{
/* Skip drives which are not mounted. */
@@ -2023,6 +2023,7 @@ dos_drive_mappings::dos_drive_mappings ()
}
while (FindNextVolumeW (sh, vol, 64));
FindVolumeClose (sh);
+ }
}
wchar_t *