ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/root-tail/root-tail.c
(Generate patch)

Comparing root-tail/root-tail.c (file contents):
Revision 1.41 by chris_moore, Wed Mar 31 16:42:22 2004 UTC vs.
Revision 1.43 by chris_moore, Wed Mar 31 17:07:02 2004 UTC

796 l += p - break_p; 796 l += p - break_p;
797 p = break_p; 797 p = break_p;
798 } 798 }
799 799
800 { 800 {
801 /* HACK-4 - consider inserting the 'continuation string'
802 * before the rest of the wrapped line */
803 int len = p - beg + (last_wrapped ? continuation_length : 0); 801 int len = p - beg + (last_wrapped ? continuation_length : 0);
804 char *s = xmalloc (len + 1); 802 char *s = xmalloc (len + 1);
805 if (last_wrapped) 803 if (last_wrapped)
806 { 804 {
807 memcpy (s, continuation, continuation_length); 805 memcpy (s, continuation, continuation_length);
902 900
903 /* print filename if any, and if last line was from 901 /* print filename if any, and if last line was from
904 * different file */ 902 * different file */
905 if (!opt_nofilename && lastprinted != current && current->desc[0]) 903 if (!opt_nofilename && lastprinted != current && current->desc[0])
906 { 904 {
907 char buf[1024]; /* HACK-5 */
908 snprintf (buf, sizeof (buf), "[%s]", current->desc);
909 split_line (listlen - 1, buf, current->color); 905 split_line (listlen - 1, "[", current->color);
906 append_line (listlen - 1, current->desc);
907 append_line (listlen - 1, "]");
910 } 908 }
911 909
912 /* if we're dealing with partial lines, and the last 910 /* if we're dealing with partial lines, and the last
913 * time we showed the line it wasn't finished ... */ 911 * time we showed the line it wasn't finished ... */
914 if (!opt_whole && current->lastpartial) 912 if (!opt_whole && current->lastpartial)
1175 fprintf (stderr, "You did not specify any files to tail\n" 1173 fprintf (stderr, "You did not specify any files to tail\n"
1176 "use %s --help for help\n", argv[0]); 1174 "use %s --help for help\n", argv[0]);
1177 exit (1); 1175 exit (1);
1178 } 1176 }
1179 1177
1178 if (opt_update && opt_whole)
1179 {
1180 fprintf (stderr, "Specify at most one of -update and -whole\n");
1181 exit (1);
1182 }
1180 if (opt_partial && opt_whole) 1183 else if (opt_partial && opt_whole)
1181 { 1184 {
1182 fprintf (stderr, "Specify at most one of -partial and -whole\n"); 1185 fprintf (stderr, "Specify at most one of -partial and -whole\n");
1183 exit (1); 1186 exit (1);
1184 } 1187 }
1185 1188

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines