mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-08 06:48:28 +00:00
40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
--- email2smssend Thu Jul 12 03:55:48 2001
|
|
+++ email2smssend Mon Oct 20 19:57:53 2003
|
|
@@ -31,7 +31,7 @@
|
|
my ($message, @tmp_messages, @messages);
|
|
my ($limit_size, $limit_sms);
|
|
my ($show_index, $reverse, $diff, $opt);
|
|
-my ($total_nb, $cpt, $prepend, $before, $after, @before__after);
|
|
+my ($total_nb, $cpt, $prepend, @before, @after);
|
|
|
|
# Display usage help.
|
|
sub Usage {
|
|
@@ -121,10 +121,13 @@
|
|
}
|
|
|
|
# Search if a parameter is "--"
|
|
-@before__after = split (/\s--\s/, join (" ", @ARGV) . " ");
|
|
-$before = $before__after[0];
|
|
-$after = $before__after[1];
|
|
-$after = " -- " . $after if ($after ne "");
|
|
+while ($opt = shift (@ARGV)) {
|
|
+ if ($opt eq "--") {
|
|
+ @after = ($opt, @ARGV);
|
|
+ last;
|
|
+ };
|
|
+ @before = (@before, $opt);
|
|
+}
|
|
|
|
# Initialize cpt
|
|
$total_nb = scalar(@messages);
|
|
@@ -140,7 +143,7 @@
|
|
$prepend = $cpt . "/$total_nb: " if ($show_index == 1);
|
|
$cpt += $diff;
|
|
# for debug, uncomment the "print" and comment the "system"
|
|
- # print $sms_bin . " " . $before . " \"" . $prepend . $_ . "\" " . $after . "\n";
|
|
- system ($sms_bin . " " . $before . " \"" . $prepend . $_ . "\" " . $after);
|
|
+ # print $sms_bin, " ", @before, " ", $prepend . $_, " ", @after, "\n";
|
|
+ system $sms_bin, @before, $prepend . $_, @after;
|
|
}
|
|
|