Imported from ../bash-3.2.48.tar.gz.
This commit is contained in:
		
					parent
					
						
							
								0628567a28
							
						
					
				
			
			
				commit
				
					
						f1be666c7d
					
				
			
		
					 47 changed files with 703 additions and 159 deletions
				
			
		|  | @ -251,19 +251,21 @@ getcwd (buf, size) | |||
| 
 | ||||
|   { | ||||
|     size_t len = pathbuf + pathsize - pathp; | ||||
|     if (buf == NULL) | ||||
|       { | ||||
| 	if (len < (size_t) size) | ||||
| 	  len = size; | ||||
| 	buf = (char *) malloc (len); | ||||
| 	if (buf == NULL) | ||||
| 	  goto lose2; | ||||
|       } | ||||
|     else if ((size_t) size < len) | ||||
|     if (buf == NULL && size <= 0) | ||||
|       size = len; | ||||
| 
 | ||||
|     if ((size_t) size < len) | ||||
|       { | ||||
| 	errno = ERANGE; | ||||
| 	goto lose2; | ||||
|       } | ||||
|     if (buf == NULL) | ||||
|       { | ||||
| 	buf = (char *) malloc (size); | ||||
| 	if (buf == NULL) | ||||
| 	  goto lose2; | ||||
|       } | ||||
| 
 | ||||
|     (void) memcpy((PTR_T) buf, (PTR_T) pathp, len); | ||||
|   } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jari Aalto
				Jari Aalto