# Fix for ALTER SYSTEM Empty String Bug

## Problem Description

When using `ALTER SYSTEM SET "shared_preload_libraries" TO ''`, PostgreSQL would write a malformed configuration entry to `postgresql.auto.conf`:

```
shared_preload_libraries = '""'
```

This malformed configuration would cause the PostgreSQL server to crash on restart.

## Root Cause

The issue occurred in the `flatten_set_variable_args` function in `src/backend/utils/misc/guc_funcs.c`. When a parameter with the `GUC_LIST_QUOTE` flag (like `shared_preload_libraries`) was set to an empty string, the function would call `quote_identifier("")` which returns `""` (double quotes around an empty string). This resulted in the malformed configuration entry.

## Solution

The fix modifies the `flatten_set_variable_args` function to check if the value is an empty string before applying the `GUC_LIST_QUOTE` logic. Empty strings are treated as "no value" rather than literal empty strings, so they are not quoted.

## Code Changes

In `src/backend/utils/misc/guc_funcs.c`, line 291:
```c
- if (flags & GUC_LIST_QUOTE)
+ if ((flags & GUC_LIST_QUOTE) && val[0] != '\0')
```

## Testing

The fix can be tested by:
1. Running `ALTER SYSTEM SET "shared_preload_libraries" TO ''`
2. Checking that `postgresql.auto.conf` does not contain malformed entries
3. Restarting PostgreSQL to verify no crashes occur

## Affected Parameters

This fix affects all GUC parameters that have the `GUC_LIST_QUOTE` flag set, including:
- `shared_preload_libraries`
- Any other list-type parameters that use quote mode 
