[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
One posibly "improvement" for date.c...
From: |
Ville solarius |
Subject: |
One posibly "improvement" for date.c... |
Date: |
Tue, 18 Apr 2006 15:12:35 +0300 |
Hi all!
Yesterday, i wrote very small patch for date-program(date.c), i peronaly needed
feature to strip out newline-sign at end of output. I hope it is
useful for whole project too, so it is free to use in date.
In fact, this is my first patch,so i just diff my date.c and cvs's
date.c, and i hope i did it right;) It is at end of this message, i
hope it works(like i sad, i havent do patches before;) Remember backup
your original date.c in case that i've done something wrong!)
In bash, there is problems with editing commandline after printing,
but that was/is bash's problem because that is standard way to print,
i think it is fixed (maybe) in newest 3.1 version's patch 13 or
something like that, if i remember right;)
Comments please!
- Solarius
PS. I personally needed it because i needed time stamp to my bash shellprompt
44,45d43
< bool use_newline = true; /* */
<
94c92
< static char const short_options[] = "nd:f:I::r:Rs:u";
---
> static char const short_options[] = "d:f:I::r:Rs:u";
98d95
< {"no-newline", no_argument, NULL, 'n'},
147d143
< -n -no-newline do not display newline at end of output\n\
341,343d336
< case 'n':
< use_newline = false;
< break;
558,563c551
<
< if (use_newline)
< {
< fputc ('\n', stdout);
< }
<
---
> fputc ('\n', stdout);
- One posibly "improvement" for date.c...,
Ville solarius <=