mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
let the past begone in cvs land. welcome to igit igit!
This commit is contained in:
commit
4e601cf1c7
509 changed files with 77963 additions and 0 deletions
50
bin/edata
Normal file
50
bin/edata
Normal file
|
@ -0,0 +1,50 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# editor for .o files -lynX
|
||||
#
|
||||
# it merely splits long lines at the end of mappings
|
||||
# so that vi-like editors aren't confronted with
|
||||
# huge one-liners. after saving it recreates the
|
||||
# original format after renaming the original file
|
||||
# into itself with appended tilde.
|
||||
#
|
||||
#sub backupsuffix() { '~' }
|
||||
|
||||
($file = shift and $file =~ /\.o$/) or die <<X;
|
||||
usage: $0 <lpmud-data-file.o>
|
||||
X
|
||||
|
||||
$tmp = "/tmp/edata.$$";
|
||||
|
||||
open(I, $file) or die "$file: $!";
|
||||
open(O, ">$tmp") or die "cannot create $tmp: $!";
|
||||
|
||||
$/ = undef;
|
||||
while(<I>) {
|
||||
s/(,]\),)/\1\n /gm;
|
||||
print O;
|
||||
}
|
||||
close I;
|
||||
close O;
|
||||
|
||||
$edit = $ENV{EDITOR} or 'vi';
|
||||
|
||||
$M = -M $tmp;
|
||||
|
||||
system("$edit $tmp");
|
||||
|
||||
exit if $M == -M $tmp;
|
||||
die $! unless rename $file, "$file~";
|
||||
print STDERR "Backup created in $file~\n";
|
||||
|
||||
open(I, $tmp) or die "$tmp: $!";
|
||||
open(O, ">$file") or die "cannot create $file: $!";
|
||||
$/ = undef;
|
||||
|
||||
while(<I>) {
|
||||
s/\n //gm;
|
||||
print O;
|
||||
}
|
||||
close I;
|
||||
close O;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue