mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-03 10:20:49 +02:00
Bash-5.3-alpha release
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
/* See Makefile for compilation details. */
|
||||
|
||||
/*
|
||||
Copyright (C) 1999-2009 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2009,2022-2023 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash.
|
||||
Bash is free software: you can redistribute it and/or modify
|
||||
@@ -37,8 +37,7 @@
|
||||
#include "bashgetopt.h"
|
||||
|
||||
int
|
||||
strftime_builtin (list)
|
||||
WORD_LIST *list;
|
||||
strftime_builtin (WORD_LIST *list)
|
||||
{
|
||||
char *format, *tbuf;
|
||||
size_t tbsize, tsize;
|
||||
@@ -68,7 +67,7 @@ strftime_builtin (list)
|
||||
|
||||
if (list && list->word->word)
|
||||
{
|
||||
n = legal_number (list->word->word, &i);
|
||||
n = valid_number (list->word->word, &i);
|
||||
if (n == 0 || i < 0 || i != (time_t)i)
|
||||
{
|
||||
sh_invalidnum (list->word->word);
|
||||
@@ -81,6 +80,12 @@ strftime_builtin (list)
|
||||
secs = NOW;
|
||||
|
||||
t = localtime (&secs);
|
||||
if (t == 0)
|
||||
{
|
||||
builtin_error ("%s: timestamp out of range", list && list->word->word ? list->word->word : "now");
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
tbsize = strlen (format) * 4;
|
||||
tbuf = 0;
|
||||
|
||||
Reference in New Issue
Block a user