The cwd code nows starts out with the filename buffer initialised
to length _POSIX_PATH_MAX.
This commit is contained in:
		
							parent
							
								
									1cdcaaee53
								
							
						
					
					
						commit
						faa08159d0
					
				|  | @ -107,3 +107,5 @@ October 1996. | |||
| 
 | ||||
| transcendental functions broken (sin, cos, tan, log) | ||||
| reported by jsc 8 Nov 96. Fixed by ??????????? | ||||
| 
 | ||||
| Fixed up initial sizes for allocated filename buffers to be _POSIX_PATH_MAX. | ||||
|  |  | |||
|  | @ -176,11 +176,20 @@ int set_cloexec(int fd, int val) | |||
| ******************************************************************************* | ||||
| */ | ||||
| 
 | ||||
| /* Posix rules: If PATH_MAX is defined, it's the length of longest path.
 | ||||
| ** Otherwise, _POSIX_PATH_MAX = 255, and is a lower bound on said length. | ||||
| */ | ||||
| #ifdef PATH_MAX | ||||
| #define scsh_path_max (PATH_MAX) | ||||
| #else | ||||
| #define scsh_path_max (_POSIX_PATH_MAX) | ||||
| #endif | ||||
| 
 | ||||
| /* Simple-minded POSIX version. */ | ||||
| int scheme_cwd(const char **dirp) | ||||
| { | ||||
|   char *buf; | ||||
|   int size = 100; | ||||
|   int size = scsh_path_max + 1; /* +1 for terminating nul byte... */ | ||||
| 
 | ||||
|   buf = Malloc(char,size); | ||||
|   if(!buf) goto lose; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 shivers
						shivers