calls, you need
to do fflush(); ferror(); fclose().
(Testing ferror() in a loop might be useful in order to abort early.)
David
--
David Laight: [EMAIL PROTECTED]
turned h is positive.
David
--
David Laight: da...@l8s.co.uk
easy' :-)
Use 'grep -n '^From ' | tail -n ' extract the line number from the
first output line and use sed (or similar) to delete the first of the file.
David
--
David Laight: da...@l8s.co.uk
#include the file in the middle a the C initialser.
2) Arrange to pass -DTEXT="text strings" on the command line to cc.
This one requires tricky quoting to get right.
Probably using as:
#define STR(x) #x
char foo[] = STR(TEXT);
will work.
David
--
David Laight: da...@l8s.co.uk
s ".
The more you can avoid in build tools, the better.
Even assuming a working awk, or some obscure grep options/variant
can be a problem, never mind monsters like perl and python.
David
--
David Laight: da...@l8s.co.uk
On Thu, Oct 18, 2012 at 09:48:32PM +0100, David Laight wrote:
> On Thu, Oct 18, 2012 at 07:06:55PM +0100, Patrick Welche wrote:
> > On Thu, Oct 18, 2012 at 12:57:52PM -0500, David Champion wrote:
> > > Does anyone else think this is problematic? I could redo it in C if
>
in whichever order works best
> 4. Require "make NATIVECC=..." when cross-compiling
>
> I'm good with 1 or 4. I'll entertain strong arguments for 2 or 3,
> especially if you're buying, but I'm not sure either is a complete
> solution. 1 and 4 are, if you accept the transference of the problem to
> documented conditions for compilation.
Don't add gratuitous build dependencies.
David
--
David Laight: da...@l8s.co.uk
d and the '-' replaced with '.'
[ "$1" = mutt ] && shift
ver="$1"
while [ $# -gt 2 ]; do
[ "$1" != rel ] && ver="$ver.$1"
shift
done
distance="$1"
cess.
3) If you give anyone write access you give everyone write access.
Most of that is because the permission checks are done by the
mount protocol - and then assume the client obeys the rules.
(2) Requires a file handle be generated - this used to be very easy!
David
--
David Laight: da...@l8s.co.uk
g it to be world readable, though.
The 'sane' umask is the one that was set by the user before mutt
was run.
You certainly shouldn't allow permissions that it excluded.
David
--
David Laight: da...@l8s.co.uk
from fprintf()
is probably broken anyway!
David
--
David Laight: da...@l8s.co.uk
error checking useless.
True, but any error is most likely to happen during the fflush()
that happens during fclose();
So if you care about errors do "fflush(); err = ferror(); fclose();"
Or call ferror() at at appropriate point in a program loop to
terminate early. Checking every fprintf() just makes the code unreadable.
David
--
David Laight: da...@l8s.co.uk
/bin])
>
> I like this. Other paths to consider:
>
> /usr/sfw/bin Sun Freeware
> /opt/sfw/bin Sun Freeware
> /opt/csw/bin Blastwave
> /opt/bin Common alternative to /usr/local/bin
> /local/bin Ditto
/usr/pkg/bin NetBSD etc
David
--
David Laight: [EMAIL PROTECTED]
ould, Mutt is used PRIMARILY to process
> arbitrary untrusted data which comes from the Internet.
In which case wouldn't 177 be better?
David
--
David Laight: [EMAIL PROTECTED]
say) a NetBSD system.
(And neither will perl)
David
--
David Laight: [EMAIL PROTECTED]
.
Also, since the redirection of {...} will enforce a subshell (at least
on some shells), requesting it explicitly by using (...) is better.
Also a conformat posix shell should have a 'type' command, and 'command -v'
which are builtins that report the location of programs.
David
--
David Laight: [EMAIL PROTECTED]
intain), what
> source file and line number
Actually these are often easier to debug is the program is allowed
to take the SIGSEGV and core dump.
Systems that convert segfaults to C++ exceptions make them almost
impossible to debug.
David
--
David Laight: [EMAIL PROTECTED]
I did once have to fight a compiler that optimised out the check:
extern int foo;
if (&foo != NULL) ...
David
[Hint look up weak elf symbols]
--
David Laight: [EMAIL PROTECTED]
the constant zero may be assigned to a
> pointer, and a pointer may be compared with the constant zero.
More particularly any compile time expression that evaluates to zero.
So 'if (ptr_var == 1 - 1)' is also valid.
David
--
David Laight: [EMAIL PROTECTED]
19 matches
Mail list logo