comparison src/fileio.c @ 5198:bc3ede8f29a8

fix spacing in some files -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-04-09 Ben Wing <ben@xemacs.org> * fileio.c (check_writable): * fileio.c (Fdo_auto_save): * redisplay-xlike-inc.c (separate_textual_runs_nomule): * redisplay-xlike-inc.c (separate_textual_runs_xft_nomule): * redisplay-xlike-inc.c (separate_textual_runs_xft_mule): * redisplay-xlike-inc.c (separate_textual_runs_mule): * redisplay-xlike-inc.c (XLIKE_output_string): * redisplay-xlike-inc.c (XLIKE_output_vertical_divider): * redisplay.c (create_text_block): * redisplay.c (regenerate_window): * redisplay.c (redisplay_window): * redisplay.c (redisplay_device): * redisplay.c (window_line_number): * redisplay.c (point_would_be_visible): * redisplay.c (compute_display_line_dynarr_usage): * specifier.c (prune_specifiers): * specifier.c (finalize_specifier): * specifier.c (make_magic_specifier): * specifier.c (charset_matches_specifier_tag_set_p): * specifier.c (Fdefine_specifier_tag): * specifier.c (setup_device_initial_specifier_tags): * specifier.c (bodily_specifier): * specifier.c (add_spec_to_ghost_specifier): * specifier.c (remove_ghost_specifier): * specifier.c (set_specifier_fallback): * specifier.c (specifier_instance_from_inst_list): * specifier.c (set_specifier_caching): Fix coding style to correspond to GNU standard.
author Ben Wing <ben@xemacs.org>
date Fri, 09 Apr 2010 23:38:02 -0500
parents 2e528066e2fc
children cdca98f2d36f
comparison
equal deleted inserted replaced
5197:ce8ffb95bbe3 5198:bc3ede8f29a8
2320 DWORD attributes; 2320 DWORD attributes;
2321 HANDLE tokenHandle; 2321 HANDLE tokenHandle;
2322 GENERIC_MAPPING genericMapping; 2322 GENERIC_MAPPING genericMapping;
2323 DWORD accessMask; 2323 DWORD accessMask;
2324 PRIVILEGE_SET PrivilegeSet; 2324 PRIVILEGE_SET PrivilegeSet;
2325 DWORD dwPrivSetSize = sizeof( PRIVILEGE_SET ); 2325 DWORD dwPrivSetSize = sizeof ( PRIVILEGE_SET );
2326 BOOL fAccessGranted = FALSE; 2326 BOOL fAccessGranted = FALSE;
2327 DWORD dwAccessAllowed; 2327 DWORD dwAccessAllowed;
2328 Extbyte *fnameext; 2328 Extbyte *fnameext;
2329 2329
2330 LOCAL_FILE_FORMAT_TO_TSTR (filename, fnameext); 2330 LOCAL_FILE_FORMAT_TO_TSTR (filename, fnameext);
2331 2331
2332 // First check for a normal file with the old-style readonly bit 2332 // First check for a normal file with the old-style readonly bit
2333 attributes = qxeGetFileAttributes(fnameext); 2333 attributes = qxeGetFileAttributes (fnameext);
2334 if (FILE_ATTRIBUTE_READONLY == (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY))) 2334 if (FILE_ATTRIBUTE_READONLY ==
2335 (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY)))
2335 return 0; 2336 return 0;
2336 2337
2337 /* Win32 prototype lacks const. */ 2338 /* Win32 prototype lacks const. */
2338 error = qxeGetNamedSecurityInfo(fnameext, SE_FILE_OBJECT, 2339 error = qxeGetNamedSecurityInfo (fnameext, SE_FILE_OBJECT,
2339 DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, 2340 DACL_SECURITY_INFORMATION|
2340 &psidOwner, &psidGroup, &pDacl, &pSacl, &pDesc); 2341 GROUP_SECURITY_INFORMATION|
2341 if(error != ERROR_SUCCESS) { // FAT? 2342 OWNER_SECURITY_INFORMATION,
2342 attributes = qxeGetFileAttributes(fnameext); 2343 &psidOwner, &psidGroup, &pDacl, &pSacl,
2343 return (attributes & FILE_ATTRIBUTE_DIRECTORY) || (0 == (attributes & FILE_ATTRIBUTE_READONLY)); 2344 &pDesc);
2344 } 2345 if (error != ERROR_SUCCESS)
2346 { // FAT?
2347 attributes = qxeGetFileAttributes (fnameext);
2348 return (attributes & FILE_ATTRIBUTE_DIRECTORY) ||
2349 (0 == (attributes & FILE_ATTRIBUTE_READONLY));
2350 }
2345 2351
2346 genericMapping.GenericRead = FILE_GENERIC_READ; 2352 genericMapping.GenericRead = FILE_GENERIC_READ;
2347 genericMapping.GenericWrite = FILE_GENERIC_WRITE; 2353 genericMapping.GenericWrite = FILE_GENERIC_WRITE;
2348 genericMapping.GenericExecute = FILE_GENERIC_EXECUTE; 2354 genericMapping.GenericExecute = FILE_GENERIC_EXECUTE;
2349 genericMapping.GenericAll = FILE_ALL_ACCESS; 2355 genericMapping.GenericAll = FILE_ALL_ACCESS;
2350 2356
2351 if(!ImpersonateSelf(SecurityDelegation)) { 2357 if (!ImpersonateSelf (SecurityDelegation))
2352 return 0; 2358 {
2353 } 2359 return 0;
2354 if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &tokenHandle)) { 2360 }
2355 return 0; 2361 if (!OpenThreadToken (GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE,
2356 } 2362 &tokenHandle))
2363 {
2364 return 0;
2365 }
2357 2366
2358 accessMask = GENERIC_WRITE; 2367 accessMask = GENERIC_WRITE;
2359 MapGenericMask(&accessMask, &genericMapping); 2368 MapGenericMask (&accessMask, &genericMapping);
2360 2369
2361 if(!AccessCheck(pDesc, tokenHandle, accessMask, &genericMapping, 2370 if (!AccessCheck(pDesc, tokenHandle, accessMask, &genericMapping,
2362 &PrivilegeSet, // receives privileges used in check 2371 &PrivilegeSet, // receives privileges used in check
2363 &dwPrivSetSize, // size of PrivilegeSet buffer 2372 &dwPrivSetSize, // size of PrivilegeSet buffer
2364 &dwAccessAllowed, // receives mask of allowed access rights 2373 &dwAccessAllowed, // receives mask of allowed access rights
2365 &fAccessGranted)) 2374 &fAccessGranted))
2366 { 2375 {
2367 CloseHandle(tokenHandle); 2376 CloseHandle (tokenHandle);
2368 RevertToSelf(); 2377 RevertToSelf();
2369 LocalFree(pDesc); 2378 LocalFree (pDesc);
2370 return 0; 2379 return 0;
2371 } 2380 }
2372 CloseHandle(tokenHandle); 2381 CloseHandle (tokenHandle);
2373 RevertToSelf(); 2382 RevertToSelf();
2374 LocalFree(pDesc); 2383 LocalFree (pDesc);
2375 return fAccessGranted == TRUE; 2384 return fAccessGranted == TRUE;
2376 #elif defined (HAVE_EACCESS) 2385 #elif defined (HAVE_EACCESS)
2377 return (qxe_eaccess (filename, W_OK) >= 0); 2386 return (qxe_eaccess (filename, W_OK) >= 0);
2378 #else 2387 #else
2379 /* Access isn't quite right because it uses the real uid 2388 /* Access isn't quite right because it uses the real uid
2957 { 2966 {
2958 end_multiple_change (buf, mc_count); 2967 end_multiple_change (buf, mc_count);
2959 2968
2960 RETURN_UNGCPRO 2969 RETURN_UNGCPRO
2961 (Fsignal (Qfile_error, 2970 (Fsignal (Qfile_error,
2962 list2 (build_msg_string("not a regular file"), 2971 list2 (build_msg_string ("not a regular file"),
2963 filename))); 2972 filename)));
2964 } 2973 }
2965 } 2974 }
2966 #endif /* S_IFREG */ 2975 #endif /* S_IFREG */
2967 2976
4259 4268
4260 set_buffer_internal (XBUFFER (old)); 4269 set_buffer_internal (XBUFFER (old));
4261 auto_saved++; 4270 auto_saved++;
4262 4271
4263 /* Handler killed their own buffer! */ 4272 /* Handler killed their own buffer! */
4264 if (!BUFFER_LIVE_P(b)) 4273 if (!BUFFER_LIVE_P (b))
4265 continue; 4274 continue;
4266 4275
4267 b->auto_save_modified = BUF_MODIFF (b); 4276 b->auto_save_modified = BUF_MODIFF (b);
4268 b->saved_size = make_int (BUF_SIZE (b)); 4277 b->saved_size = make_int (BUF_SIZE (b));
4269 EMACS_GET_TIME (after_time); 4278 EMACS_GET_TIME (after_time);