meaning of the construction: ${1+"$@"} ?

Whoud anybody explain the reason to have such construction in code: ${1+"$@"}

It is used in the function that replasing functionality of the 'cd' command by processing the 'cd' itself and after that processing some other stuff:

chdir() {
   'cd' ${1+"$@"}
   ...  #other stuff
}

I understand it intends to aply function parameters to the 'cd' command.
I do not understand NEEDS for that extra-smartness.
Why not just '$*' or '$@'?
Also I am not clear about that syntaxis: I see it use the first parameter: $1, ${1}; but the '+"..."' - what is it?
If that is kind of concatenation, the "$@" - means all parameters (as set of words, I guess); so it would duplicate the first parameter: it is already mentioned before '+' and also included in $@; but, not, it is not repeating.

If someone could explain what is used here and what is the benefit from that sysntax, I will appreciate!

see Table 4.2 of this link

Thanks ctsgnb for that link: very usefull (I familiar with most of that from bash-man pages, but from O'Relly it is much better!)
But nothing is explained!

I see that the ${1+"$@"} would be all parameters if $1 exist or nothing, if not.

SO WHAT?!

What is the reason to have that?!!?

The '$*' or '$@' would do the same!

What the point?

I thought your question was about the ${...+...} notation.

if it is about the $* and $@, then go there

I guess it is to cover the case where the directory has some space or tab in its name or something like this, or maybe for compatible reason with some OS

oops...
Oh .... ok now i understand your question ...

What is the benefit from ${1+"$@"} notation intead of just "$@" ?
I dunnot .

Error detection on empty var may be different between $1 and $@ on some unix ??? i have no idea ... maybe having a look at the rest of the code could give some clue ?
But so far, i have no idea ... :confused:

Once again, Thanks ctsgnb for replay!
Appreciate to see your thoughts.
... some space or tab .. - OK, reasonable to apply the $@; so it would keep the word with spase as one word!
Good point!
Anything else is not a case, as I see it here: followed code (just couple line to set the 'prompt') have no relation to first 'cd' command; all other guesses are not reasonable in here (unless the code was used from some source where other your points could be meaningfull.)

I have check situation with a space and a new line in the dir-name. Here is the test-code and results:

> typeset -f tst
tst ()
{
    cdir=$(pwd);
    echo "starting in >${cdir}< directory.";
    echo "<"${1+$@}">";
    echo "\$@ is:"$@"<";
    \cd $@;
    echo "after \\cd \$@; now in $(pwd)";
    chdir $cdir;
    \cd ${1+$@};
    echo "after \\cd \${1+\$@}; now in $(pwd)";
    chdir $cdir;
    'cd' ${1+"$@"};
    echo "after 'cd' \${1+\"\$@\"}; now in $(pwd)";
    chdir $cdir;
    \cd "$@";
    echo "after \\cd \"\$@\"; now in $(pwd)";
    chdir $cdir
}
P> mkdir TST_dir "TST dir" "TST
> dir"
>
> tst TST_dir
starting in >/export/home/dca/TMP< directory.
<TST_dir>
$@ is:TST_dir<
after \cd $@; now in /export/home/dca/TMP/TST_dir
after \cd ${1+$@}; now in /export/home/dca/TMP/TST_dir
after 'cd' ${1+"$@"}; now in /export/home/dca/TMP/TST_dir
after \cd "$@"; now in /export/home/dca/TMP/TST_dir
> tst "TST dir"
starting in >/export/home/dca/TMP< directory.
<TST dir>
$@ is:TST dir<
bash: cd: TST: No such file or directory
after \cd $@; now in /export/home/dca/TMP
bash: cd: TST: No such file or directory
after \cd ${1+$@}; now in /export/home/dca/TMP
after 'cd' ${1+"$@"}; now in /export/home/dca/TMP/TST dir
after \cd "$@"; now in /export/home/dca/TMP/TST dir
> tst "TST
> dir"
starting in >/export/home/dca/TMP< directory.
<TST dir>
$@ is:TST dir<
bash: cd: TST: No such file or directory
after \cd $@; now in /export/home/dca/TMP
bash: cd: TST: No such file or directory
after \cd ${1+$@}; now in /export/home/dca/TMP
after 'cd' ${1+"$@"}; now in /export/home/dca/TMP/TST
dir
after \cd "$@"; now in /export/home/dca/TMP/TST
dir

So, by this testing the '\cd "$@" ' is completely suffisient. Most important, it is strait forward with nothing extra; no extra functionality, no questions.

Maybe anybody see anything else that would be a reason to have 'cd' ${1+"$@"} instead of the \cd "$@" ?

Thanks!

---------- Post updated 01-20-11 at 01:08 PM ---------- Previous update was 01-19-11 at 03:53 PM ----------

I have the answer from another place: here
and this question was discussed also here2

Shortly, that syntax provide appropriate 'cd' functionality with no-arguments when "$@" for no-arguments returned empty string, instead of 'nothing' (as it was 20 years ago.)
cd - with 'nothing' change to home-dir;
cd "" - with empty string stay in current dir (so, it is the >cd . )

But today the "$@" return correctly nothing and 'cd' will process "$@" appropriately.