tools/inc/lib/jsgettext/: apply fixes from bugtracker
This commit is contained in:
parent
74f4c7da18
commit
f7d7981248
@ -10,7 +10,7 @@
|
|||||||
'-k' => '_'
|
'-k' => '_'
|
||||||
);
|
);
|
||||||
$len = count($args);
|
$len = count($args);
|
||||||
$i = 0;
|
$i = 1;
|
||||||
while ($i < $len) {
|
while ($i < $len) {
|
||||||
if (preg_match('#^-[a-z]$#i', $args[$i])) {
|
if (preg_match('#^-[a-z]$#i', $args[$i])) {
|
||||||
$options[$args[$i]] = isset($args[$i+1]) ? trim($args[$i+1]) : true;
|
$options[$args[$i]] = isset($args[$i+1]) ? trim($args[$i+1]) : true;
|
||||||
@ -26,7 +26,11 @@
|
|||||||
|
|
||||||
$options = buildOptions($argv);
|
$options = buildOptions($argv);
|
||||||
|
|
||||||
if (!file_exists($options['-o']) || !is_writable($options['-o'])) {
|
if (!file_exists($options['-o'])) {
|
||||||
|
touch($options['-o']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_writable($options['-o'])) {
|
||||||
die("Invalid output file name. Make sure it exists and is writable.");
|
die("Invalid output file name. Make sure it exists and is writable.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user