pch.c (1.19) | pch.c (1.20) |
---|---|
1/* $NetBSD: pch.c,v 1.19 2003/07/30 08:51:04 itojun Exp $ */ | 1/* $NetBSD: pch.c,v 1.20 2006/04/09 19:03:32 christos Exp $ */ |
2 3/* 4 * Copyright (c) 1988, Larry Wall 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following condition 8 * is met: 9 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 19 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 20 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 22 * SUCH DAMAGE. 23 */ 24 25#include <sys/cdefs.h> 26#ifndef lint | 2 3/* 4 * Copyright (c) 1988, Larry Wall 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following condition 8 * is met: 9 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 19 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 20 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 22 * SUCH DAMAGE. 23 */ 24 25#include <sys/cdefs.h> 26#ifndef lint |
27__RCSID("$NetBSD: pch.c,v 1.19 2003/07/30 08:51:04 itojun Exp $"); | 27__RCSID("$NetBSD: pch.c,v 1.20 2006/04/09 19:03:32 christos Exp $"); |
28#endif /* not lint */ 29 30#include "EXTERN.h" 31#include "common.h" 32#include "util.h" 33#include "INTERN.h" 34#include "pch.h" 35 --- 218 unchanged lines hidden (view full) --- 254 this_is_a_command = 255 isdigit((unsigned char)*s) && 256 (*t == 'd' || *t == 'c' || *t == 'a'); 257 if (first_command_line < 0L && this_is_a_command) { 258 first_command_line = this_line; 259 fcl_line = p_input_line; 260 p_indent = indent; /* assume this for now */ 261 } | 28#endif /* not lint */ 29 30#include "EXTERN.h" 31#include "common.h" 32#include "util.h" 33#include "INTERN.h" 34#include "pch.h" 35 --- 218 unchanged lines hidden (view full) --- 254 this_is_a_command = 255 isdigit((unsigned char)*s) && 256 (*t == 'd' || *t == 'c' || *t == 'a'); 257 if (first_command_line < 0L && this_is_a_command) { 258 first_command_line = this_line; 259 fcl_line = p_input_line; 260 p_indent = indent; /* assume this for now */ 261 } |
262 if (!stars_last_line && strnEQ(s, "*** ", 4)) | 262 if (!stars_last_line && strnEQ(s, "*** ", 4)) { 263 if (oldtmp) 264 free(oldtmp); |
263 oldtmp = xstrdup(s + 4); | 265 oldtmp = xstrdup(s + 4); |
264 else if (strnEQ(s, "--- ", 4)) | 266 } else if (strnEQ(s, "--- ", 4)) { 267 if (newtmp) 268 free(newtmp); |
265 newtmp = xstrdup(s + 4); | 269 newtmp = xstrdup(s + 4); |
266 else if (strnEQ(s, "+++ ", 4)) | 270 } else if (strnEQ(s, "+++ ", 4)) { 271 if (oldtmp) 272 free(oldtmp); |
267 oldtmp = xstrdup(s + 4); /* pretend it is the old name */ | 273 oldtmp = xstrdup(s + 4); /* pretend it is the old name */ |
268 else if (strnEQ(s, "Index:", 6)) | 274 } else if (strnEQ(s, "Index:", 6)) { 275 if (indtmp) 276 free(indtmp); |
269 indtmp = xstrdup(s + 6); | 277 indtmp = xstrdup(s + 6); |
270 else if (strnEQ(s, "Prereq:", 7)) { | 278 } else if (strnEQ(s, "Prereq:", 7)) { |
271 for (t = s + 7; isspace((unsigned char)*t); t++) 272 ; | 279 for (t = s + 7; isspace((unsigned char)*t); t++) 280 ; |
281 if (revision) 282 free(revision); |
|
273 revision = xstrdup(t); 274 for (t = revision; 275 *t && !isspace((unsigned char)*t); 276 t++) 277 ; 278 *t = '\0'; | 283 revision = xstrdup(t); 284 for (t = revision; 285 *t && !isspace((unsigned char)*t); 286 t++) 287 ; 288 *t = '\0'; |
279 if (!*revision) { | 289 if (*revision == '\0') { |
280 free(revision); 281 revision = NULL; 282 } 283 } 284 if ((!diff_type || diff_type == ED_DIFF) && 285 first_command_line >= 0L && 286 strEQ(s, ".\n") ) { 287 p_indent = indent; --- 1065 unchanged lines hidden --- | 290 free(revision); 291 revision = NULL; 292 } 293 } 294 if ((!diff_type || diff_type == ED_DIFF) && 295 first_command_line >= 0L && 296 strEQ(s, ".\n") ) { 297 p_indent = indent; --- 1065 unchanged lines hidden --- |