- cur_col = pad_output (cur_col, com_col);
- write (output, s_com, e_com - s_com);
-
- cur_col = count_spaces (cur_col, s_com);
- if ((cur_col - 1) > max_col && output!=1)/* check for too long comment */
- printf ("%d: Comment goes to column %d. Max is %d\n",
- line_no, (cur_col - 1), max_col);
-
- bl_line = false;
- ++com_lines; /* count lines with comments */
+ else
+ cur_col = 1; /* there is no label section */
+
+ ps.pcase = false;
+
+ if (s_code != e_code) { /* print code section, if any */
+ register char *p;
+
+ if (comment_open) {
+ comment_open = 0;
+ fprintf(output, ".*/\n");
+ }
+ target_col = compute_code_target();
+ {
+ register i;
+
+ for (i = 0; i < ps.p_l_follow; i++)
+ if (ps.paren_indents[i] >= 0)
+ ps.paren_indents[i] = -(ps.paren_indents[i] + target_col);
+ }
+ cur_col = pad_output(cur_col, target_col);
+ for (p = s_code; p < e_code; p++)
+ if (*p == 0200)
+ fprintf(output, "%d", target_col * 7);
+ else
+ putc(*p, output);
+ cur_col = count_spaces(cur_col, s_code);
+ }
+ if (s_com != e_com)
+ if (troff) {
+ register char *p;
+
+ if (e_com[-1] == '/' && e_com[-2] == '*')
+ e_com -= 2;
+ while (e_com > s_com && e_com[-1] == ' ')
+ e_com--;
+ *e_com = 0;
+ p = s_com;
+ while (*p == ' ')
+ p++;
+ if (p[0] == '/' && p[1] == '*')
+ p += 2;
+ else if (p[0] == '*')
+ p += p[1] == '/' ? 2 : 1;
+ while (*p == ' ')
+ p++;
+ if (*p == 0)
+ goto inhibit_newline;
+ if (!comment_open) {
+ if ('a' <= *p && *p <= 'z')
+ *p = *p + 'A' - 'a';
+ if (s_code != e_code || s_lab != e_lab) {
+ fprintf(output, "\\c\n./* %dp 1 %dp\n",
+ ps.com_col * 7, target_col * 7);
+ }
+ else
+ fprintf(output, "./* %dp 0 %dp\n",
+ ps.com_col * 7, target_col * 7);
+ }
+ comment_open = 1;
+ while (*p) {
+ if (*p == BACKSLASH)
+ putc(BACKSLASH, output);
+ putc(*p++, output);
+ }
+ }
+ else { /* print comment, if any */
+ register target = ps.com_col;
+ register char *com_st = s_com;
+
+ target += ps.comment_delta;
+ while (target <= 0)
+ if (*s_com == ' ')
+ target++, s_com++;
+ else if (*s_com == '\t')
+ target = ((target - 1) & ~7) + 9, s_com++;
+ else
+ target = 1;
+ if (cur_col > target) { /* if comment cant fit on this
+ * line, put it on next line */
+ putc('\n', output);
+ cur_col = 1;
+ ++ps.out_lines;
+ }
+ cur_col = pad_output(cur_col, target);
+ if (!ps.box_com) {
+ if (star_comment_cont && com_st[1] != '*')
+ if (com_st[1] == ' ' && com_st[0] == ' ')
+ com_st[1] = '*';
+ else
+ fwrite(" * ", com_st[0] == '\t' ? 2 : com_st[0] == '*' ? 1 : 3, 1, output);
+ }
+ fwrite(com_st, e_com - com_st, 1, output);
+ ps.comment_delta = ps.n_comment_delta;
+ cur_col = count_spaces(cur_col, com_st);
+ ++ps.com_lines; /* count lines with comments */
+ }
+ if (ps.use_ff)
+ putc('\014', output);
+ else
+ putc('\n', output);
+inhibit_newline:
+ ++ps.out_lines;
+ if (ps.just_saw_decl == 1 && blanklines_after_declarations) {
+ prefix_blankline_requested = 1;
+ ps.just_saw_decl = 0;
+ }
+ else
+ prefix_blankline_requested = postfix_blankline_requested;
+ postfix_blankline_requested = 0;