Deleted Added
full compact
diff.c (54427) diff.c (66525)
1/* GNU DIFF entry routine.
2 Copyright (C) 1988, 1989, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
3
4This file is part of GNU DIFF.
5
6GNU DIFF is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)

--- 233 unchanged lines hidden (view full) ---

242 int show_c_function = 0;
243 int optind_old;
244 int opened_file = 0;
245
246 callbacks = callbacks_arg;
247
248 /* Do our initializations. */
249 initialize_main (&argc, &argv);
1/* GNU DIFF entry routine.
2 Copyright (C) 1988, 1989, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
3
4This file is part of GNU DIFF.
5
6GNU DIFF is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)

--- 233 unchanged lines hidden (view full) ---

242 int show_c_function = 0;
243 int optind_old;
244 int opened_file = 0;
245
246 callbacks = callbacks_arg;
247
248 /* Do our initializations. */
249 initialize_main (&argc, &argv);
250
251 /* Decode the options. */
252
253 optind_old = optind;
254 optind = 0;
250 optind_old = optind;
251 optind = 0;
252
253 /* Set the jump buffer, so that diff may abort execution without
254 terminating the process. */
255 val = setjmp (diff_abort_buf);
256 if (val != 0)
257 {
258 optind = optind_old;
259 if (opened_file)
260 fclose (outfile);
261 return val;
262 }
263
264 /* Decode the options. */
255 while ((c = getopt_long (argc, argv,
256 "0123456789abBcC:dD:efF:hHiI:lL:nNpPqrsS:tTuU:vwW:x:X:y",
257 longopts, 0)) != EOF)
258 {
259 switch (c)
260 {
261 /* All digits combine in decimal to specify the context-size. */
262 case '1':

--- 418 unchanged lines hidden (view full) ---

681 {
682 perror_with_name ("could not open output file");
683 return 2;
684 }
685 opened_file = 1;
686 }
687 }
688
265 while ((c = getopt_long (argc, argv,
266 "0123456789abBcC:dD:efF:hHiI:lL:nNpPqrsS:tTuU:vwW:x:X:y",
267 longopts, 0)) != EOF)
268 {
269 switch (c)
270 {
271 /* All digits combine in decimal to specify the context-size. */
272 case '1':

--- 418 unchanged lines hidden (view full) ---

691 {
692 perror_with_name ("could not open output file");
693 return 2;
694 }
695 opened_file = 1;
696 }
697 }
698
689 /* Set the jump buffer, so that diff may abort execution without
690 terminating the process. */
691 val = setjmp (diff_abort_buf);
692 if (val != 0)
693 {
694 optind = optind_old;
695 if (opened_file)
696 fclose (outfile);
697 return val;
698 }
699
700 val = compare_files (0, argv[optind], 0, argv[optind + 1], 0);
701
702 /* Print any messages that were saved up for last. */
703 print_message_queue ();
704
705 free (switch_string);
706
707 optind = optind_old;

--- 434 unchanged lines hidden (view full) ---

1142
1143 if (inf[0].desc == -2)
1144 if ((inf[0].desc = open (inf[0].name, O_RDONLY, 0)) < 0)
1145 {
1146 perror_with_name (inf[0].name);
1147 failed = 1;
1148 }
1149 if (inf[1].desc == -2)
699 val = compare_files (0, argv[optind], 0, argv[optind + 1], 0);
700
701 /* Print any messages that were saved up for last. */
702 print_message_queue ();
703
704 free (switch_string);
705
706 optind = optind_old;

--- 434 unchanged lines hidden (view full) ---

1141
1142 if (inf[0].desc == -2)
1143 if ((inf[0].desc = open (inf[0].name, O_RDONLY, 0)) < 0)
1144 {
1145 perror_with_name (inf[0].name);
1146 failed = 1;
1147 }
1148 if (inf[1].desc == -2)
1150 if (same_files)
1151 inf[1].desc = inf[0].desc;
1152 else if ((inf[1].desc = open (inf[1].name, O_RDONLY, 0)) < 0)
1153 {
1154 perror_with_name (inf[1].name);
1155 failed = 1;
1156 }
1149 {
1150 if (same_files)
1151 inf[1].desc = inf[0].desc;
1152 else if ((inf[1].desc = open (inf[1].name, O_RDONLY, 0)) < 0)
1153 {
1154 perror_with_name (inf[1].name);
1155 failed = 1;
1156 }
1157 }
1157
1158#if HAVE_SETMODE
1159 if (binary_I_O)
1160 for (i = 0; i <= 1; i++)
1161 if (0 <= inf[i].desc)
1162 setmode (inf[i].desc, O_BINARY);
1163#endif
1164

--- 94 unchanged lines hidden ---
1158
1159#if HAVE_SETMODE
1160 if (binary_I_O)
1161 for (i = 0; i <= 1; i++)
1162 if (0 <= inf[i].desc)
1163 setmode (inf[i].desc, O_BINARY);
1164#endif
1165

--- 94 unchanged lines hidden ---