sort: ignore trailing newline while sorting
This commit is contained in:
		
							
								
								
									
										3
									
								
								sort.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								sort.c
									
									
									
									
									
								
							@@ -245,7 +245,8 @@ columns(char *line, const struct keydef *kd)
 | 
				
			|||||||
		else
 | 
							else
 | 
				
			||||||
			end = end_column(end);
 | 
								end = end_column(end);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		end = line + strlen(line);
 | 
							if((end = strchr(line, '\n')) == NULL)
 | 
				
			||||||
 | 
								end = strchr(line, '\0');
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if((res = strndup(start, end - start)) == NULL)
 | 
						if((res = strndup(start, end - start)) == NULL)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user